window.location.href在Ipad和Iphone中不起作用

我在表单中使用了Google Login API。 登录用户后,我使用window.location.href将用户重定向到另一个页面,但它在iPadiPhone不起作用。

 window.location.href = "http://example.com/test"; 

删除href ,如下所示

 window.location = "http://example.com/test";