Can anyone tell the jquery code for automatic refreshing of a page.
I've always used
window.location = window.location
But it turns out that
window.location.reload()
exists, and it also more semantically correct.
Of course, this is not jQuery. Remember jQuery is a framework built on top of the JavaScript language.
If you wanted to do it after a certain time, wrap it with setTimeout().
window.setTimeout(function() {
window.location = window.location
}, 1500);
i am using something like this -
jQuery(".form_" + form_count).html("<div id='message'></div>")
jQuery('#message').html("<center><h2><br><br>Thank You Your form has been submitted.</h2></center>")
window.setTimeout(function() {
history.go(-1);
}, 1950);
Now what i want is that after the browser has moved one page back to history that page should be refreshed . I tried using the above answers but no help.
Hi. Refer this link which is helpful for you http://www.brightcherry.co.uk/scribbles/2009/02/26/jquery-auto-refresh-div-every-x-seconds/
window.location.reload() is equivalent to pressing the reload button in your browser.
window.location = window.location is equivalent to pressing enter in the address bar.
When you call window.location.reload(), all other resources are also revalidated. This means the cache fresness for all stylesheets, scripts and images is checked by performing extra HTTP-requests. At least in Firefox this behavior exists, I don't know how other browsers behave.