Reloading the Page


location.reload(); 

The reload() method of the location object reloads the current page, which is equivalent to location.href = location.href. If you provide TRue as a parameter, caching is disabled and the browser does a "hard" reload from the server. However, this is also not bulletproof, since there could be a proxy server in between that could have a cached copy of the requested page. So you could use the "Preventing Caching" phrase technique from this chapter instead:

location.search = "?" + Math.random(); 


This changes the query string (location.search) of the current page, effectively reloading the URL reload().




JavaScript Phrasebook(c) Essential Code and Commands
JavaScript Phrasebook
ISBN: 0672328801
EAN: 2147483647
Year: 2006
Pages: 178

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net