jQuery:单击按钮刷新/重新加载页面 [英] Jquery : Refresh/Reload the page on clicking a button
本文介绍了jQuery:单击按钮刷新/重新加载页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个按钮,会在ajax调用后加载,点击后我想重新加载页面(就像我按f5一样)
I have a button which loads after a ajax call , on clicking i want to reload the page (like i press f5)
我尝试了
$( ".delegate_update_success" ).click(function() {
location.reload();
});
但是它进行了简单的刷新,但是我的页面没有提出新请求来获取内容. 就像我输入URL来获取该页面一样.
but it does a simple refresh, but my page does not makes a new request to get the contents. It should happen just like I am entering URL to get that page.
推荐答案
您应该使用location.reload(true)
,它将释放该特定页面的缓存并强制该页面以 NEW 的形式加载页面.
You should use the location.reload(true)
, which will release the cache for that specific page and force the page to load as a NEW page.
true
参数强制页面释放其缓存.
The true
parameter forces the page to release it's cache.
这篇关于jQuery:单击按钮刷新/重新加载页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文