• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Q&A

Q1:I can use history and document instead of window.history and window. document. Can I leave out the window object in other cases?
A1: Yes. For example, you can use alert instead of window.alert to display a message. The window object contains the current script, so it's treated as a default object. However, be warned that you shouldn't omit the window object's name when you're using frames, layers, or multiple windows, or in an event handler.
Q2:I used the document.lastModified method to display a modification date for my page, but it displays a date in 1970, or a date that I know is incorrect. What's wrong?
A2: This function depends on the server sending the last modified date of the document to the browser. Some Web servers don't do this properly, or require specific file attributes in order for this to work.
Q3:Can I change history entries, or prevent the user from using the Back and Forward buttons?
A3: You can't change the history entries. You can't prevent the use of the Back and Forward buttons, but you can use the location.replace() method to load a series of pages that don't appear in the history. However, the Back button will still take the user to the page they visited before yours.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint