javascript 浏览器支持 window.location.reload(true)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10876244/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 11:19:35  来源:igfitidea点击:

Browser support for window.location.reload(true)

javascriptbrowser-support

提问by Adam

window.location.reload()is supported in all browsers, according to w3schools

window.location.reload()根据w3schools 的说法,所有浏览器都支持

But what's with window.location.reload(true)which reloads the page without cache? How well is it supported?

但是window.location.reload(true)在没有缓存的情况下重新加载页面有什么用?它的支持程度如何?

采纳答案by Delan Azabani

location.reload()takes no arguments in the specification, so do not rely on it. It is implemented in some browsers though, including Mozilla Firefox.

location.reload()规范中没有参数,所以不要依赖它。不过,它在某些浏览器中实现,包括Mozilla Firefox

回答by Hitesh

reload()is supposed to accept an argument which tells it to do a hard reload, ie, ignoring the cache:

reload()应该接受一个参数,告诉它进行硬重新加载,即忽略缓存:

location.reload(true);

Note : I don`t think just saying that it is supported with FF is right, hereit is clearly mentioned that it is supported by other browser as well.

注意:我认为只是说FF支持它是对的,这里明确提到其他浏览器也支持它。

Check out below links for more information

查看以下链接了解更多信息

how-can-i-refresh-a-page-with-jquery

How-can-i-refresh-a-page-with-jquery

Reload without cache

无缓存重新加载

Location.reload

位置.reload

Reload method

重装方法

refresh-reload-page-using-jquery

刷新重新加载页面使用 jquery

Is Window.location.reload(true)?

是 Window.location.reload(true) 吗?

Little Extra information in this question

这个问题中的额外信息很少

difference-between-window-location-href-window-location-href-and-window-location

窗口位置之间的差异-href-window-location-href-and-window-location

Hope this helps

希望这可以帮助