window.location.href在IOS上不生效

 

H5中发现一个问题,window/location.href在安卓上正常生效,但是IOS上不能跳转。

需要和下面一样做个判断。

if (navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) {
location.href = '/dealSuccess/' + orderNum;//此处判断是否为ios后,使用location.href跳转
}
window.location.href = '/dealSuccess/' + orderNum;//安卓跳转

 

posted @ 2023-11-06 08:52  ZQ-404  阅读(1343)  评论(0)    收藏  举报