View Single Post
  #1 (permalink)  
Old July 27th, 2010, 10:40 AM
adamshire adamshire is offline
Registered User
 
Join Date: Jul 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default chapter 3 question

on page 89-90 in the function checkComments...

Code:
if (aData[0] != iLastCommentId) {                   
                    
                    iLastCommentId = aData[0];
                    
                    if (iLastCommentId != -1) {                        
                        showNotification(aData[1], aData[2]);
                    }
                    
                }
Shouldn't
Code:
iLastCommentId = aData[0];
come after
Code:
 if (iLastCommentId != -1) {                        
                        showNotification(aData[1], aData[2]);
                    }
otherwise if there is already a comment when you get to the page, it will display, even if it was posted a year ago. If you make the change I'm suggesting, you would only see comments that were posted since you loaded the page. right?