我如何使用jQuery刷新页面?
我如何使用jQuery刷新页面?
  使用location.reload() : 
$('#something').click(function() {
    location.reload();
});
  reload()函数采用一个可选参数,该参数可以设置为true以强制从服务器而不是缓存重新加载。  该参数默认为false ,因此默认情况下该页面可能会从浏览器的缓存中重新加载。 
这应该适用于所有浏览器,即使没有jQuery:
location.reload();
有多种无限制的方式可以用JavaScript刷新页面:
location.reload() history.go(0) location.href = location.href location.href = location.pathname location.replace(location.pathname)  location.reload(false) 
  如果我们需要再次从Web服务器获取文档(例如文档内容动态变化的地方),我们会将参数传递为true 。 
您可以继续创建列表:
window.location = window.location window.self.window.self.window.window.location = window.location var methods = [
  "location.reload()",
  "history.go(0)",
  "location.href = location.href",
  "location.href = location.pathname",
  "location.replace(location.pathname)",
  "location.reload(false)"
];
var $body = $("body");
for (var i = 0; i < methods.length; ++i) {
  (function(cMethod) {
    $body.append($("<button>", {
      text: cMethod
    }).on("click", function() {
      eval(cMethod); // don't blame me for using eval
    }));
  })(methods[i]);
}button {
  background: #2ecc71;
  border: 0;
  color: white;
  font-weight: bold;
  font-family: "Monaco", monospace;
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.5s ease;
  margin: 2px;
}
button:hover {
  background: #27ae60;
}<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
                        链接地址: http://www.djcxy.com/p/747.html
                        
                        
                    