JavaScript: The Definitive Guide

Previous Chapter 21
JavaScript Reference

Location.reload() Method


Location.reload() Method---reload the current document


Navigator 3.0





A Boolean argument that specifies whether the document should be reloaded, even if the server reports that it has not been modified since it was last loaded. If this argument is omitted, or if it is false, then the method will only reload the full page if it has changed since last loaded.




The reload() method of the Location object reloads the document that is currently displayed in the window of the Location object. When called with no arguments, or with the argument false, it uses the If-Modified-Since HTTP header to determine whether the document has changed on the web server. If it has, it reloads the document from the server, and if not, it reloads the document from the cache. This is is the same action that occurs when the user clicks on Navigator's Reload button.

When reload() is called with the argument true, then it will always bypass the cache and reload the document from the server, regardless of the last-modified time of the document. This is the same action that occurs when the user shift-clicks on Navigator's Reload button.

See Also

"Location", "Location.replace()"

Previous Home Next
Location.protocol Book Index Location.replace()

HTML: The Definitive Guide CGI Programming JavaScript: The Definitive Guide Programming Perl WebMaster in a Nutshell
Hosted by uCoz