本文介绍了使用window.location在iPad上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用一些 JavaScript
,它会在一段固定的时间后将用户重定向到另一个 URL
。这在所有浏览器上运行良好,但在iPad 3上我必须测试它不起作用。超时触发,我打电话
I'm using some JavaScript
that will redirect the user to another URL
after a fixed period of time. This is working well on all browsers but on an iPad 3 I have to test on it isn't working. The timeout fires and I call
window.location = "www.someurl.com";
我也试过
window.location.href = "www.someurl.com";
我可以在浏览器中看到 URL
更改为 www.someurl.ocom
但浏览器实际上没有去那里 - 它保持在同一页面上。
I can see the URL
in the browser changing to www.someurl.ocom
but the browser doesn't actually go there - it stays on the same page.
我有什么特定的iPad要做才能使这个工作吗?
Is there something iPad specific I have to do to make this work?
谢谢
推荐答案
尝试
location.href =...
,应该同时适用于
这篇关于使用window.location在iPad上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!