使用JS刷新浏览器窗口 [英] Refresh browser window using JS

查看:88
本文介绍了使用JS刷新浏览器窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下代码刷新浏览器窗口:

I am trying to refresh the browser window using the following code:

window.location = window.location.href;

但它不会刷新窗口,但是当我尝试这样做时:

but it doesn't refresh the window, however when I try to do this:

window.location = "http://www.google.com";

它会将我重定向到Google。谁能告诉我这里我做错了什么?为什么不刷新浏览器窗口?

It does redirect me to Google. Can anyone please tell me what I am doing wrong here? Why doesn't it refresh the browser window?

推荐答案

使用 window.location.reload(),它确实如此。

这篇关于使用JS刷新浏览器窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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