如何使用jQuery刷新页面? [英] How can I refresh a page with jQuery?

查看:163
本文介绍了如何使用jQuery刷新页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用jQuery刷新页面?

How can I refresh a page with jQuery?

推荐答案

使用 location.reload()

$('#something').click(function() {
    location.reload();
});

reload()函数可选可以设置为 true的参数强制从服务器而不是缓存重新加载。参数默认为 false ,因此默认情况下页面可能会从浏览器的缓存中重新加载。

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.

这篇关于如何使用jQuery刷新页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆