The reload() function takes an optional parameter that can be set to true to force a reload from the server rather than the cache. The parameter defaults to false, so by default the page may reload from the browser's cache.
Alright, I think I got what you're asking for. Try this
if(window.top==window) {
// You're not in a frame, so you reload the site.
window.setTimeout('location.reload()', 3000); //Reloads after three seconds
}
else {
//You're inside a frame, so you stop reloading.
}
Best Answer
Use
location.reload()
.For example, to reload whenever an element with
id="something"
is clicked:The
reload()
function takes an optional parameter that can be set totrue
to force a reload from the server rather than the cache. The parameter defaults tofalse
, so by default the page may reload from the browser's cache.