关于Android的window/location/href不跳转

问题背景:window.location.href 在Android手机微信浏览器 不跳转,没反应。

 

1、在href的链接后面拼接随机数

window.location.href = url + '?v=' + (new Date().getTime());

或 top.window.location = url + '?v=' + (new Date().getTime());

 

2、如果修改了以上还不生效,那就是需要你在触发 跳转时关闭手机网络代理,就OK了。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
window.location.hrefwindow.opener.location.href都是用于获取或设置当前页面的URL。 window.location.href是获取或设置当前页面的URL。可以通过将一个新的URL赋值给window.location.href来导航到该URL。例如,可以使用window.location.href = "https://www.example.com"将当前页面导航到https://www.example.com。 window.opener.location.href是获取或设置打开当前页面的父页面的URL。它在使用window.open()方法打开一个新窗口后才有值。可以通过将一个新的URL赋值给window.opener.location.href来导航到父页面的URL。例如,可以使用window.opener.location.href = "https://www.parentpage.com"将父页面导航到https://www.parentpage.com。 需要注意的是,window.opener.location.href只能在通过window.open()方法打开的新窗口中使用,而不能在同一窗口或不是通过window.open()方法打开的窗口中使用。而window.location.href可以在任何窗口中使用。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [window.location.href的用法(动态输出跳转)](https://blog.csdn.net/weixin_31690531/article/details/115238595)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值