Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
210 views
in Technique[技术] by (71.8m points)

ios返回不执行js怎么解决?

苹果手机返回上一页不执行js吗?

我在当前页存储了数据,然后history.back返回上一页,在上一页中把数据取出来,安卓没问题,谷歌浏览器没问题,就苹果没有取到,感觉是因为不走js的原因。
有什么解决办法吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
window.onpageshow = function (e) {
 if (e.persisted) {
       window.location.reload(true)
 } 
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...