document.location.href在Chrome浏览器中不起作用 [英] The document.location.href is not working in Chrome browser

查看:648
本文介绍了document.location.href在Chrome浏览器中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

命令:

The command:

document.location.href="www.google.com" 

不会更改google chrome浏览器中的当前网页。该命令确实在IE9浏览器中传输页面。

Does not change the current web page in the google chrome browser. The command does transfer the page in the IE9 browser.

为什么这个命令对IE9有效,但对chrome不起作用?

Why would this command work for IE9 but not for chrome?

推荐答案

另一种解决方案是在 document.location.href

window.event.returnValue = false;

来源: document.location不会改变IE9的网页?

这篇关于document.location.href在Chrome浏览器中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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