search

Home  >  Q&A  >  body text

javascript - How to solve the problem that ios returns js without executing it?

Doesn’t Apple mobile phone execute js when returning to the previous page?

I stored the data on the current page, then history.back returned to the previous page, and took out the data on the previous page. There was no problem with Android, and there was no problem with Google Chrome, but Apple didn't get it. I feel it's because it didn't get it. The reason for using js.
Is there any solution?

PHPzPHPz2843 days ago544

reply all(2)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-16 13:40:25

    window.onpageshow = function (e) {
     if (e.persisted) {
           window.location.reload(true)
     } 
    }

    reply
    0
  • 迷茫

    迷茫2017-05-16 13:40:25

    Under normal circumstances, js will be used when returning. It is recommended that you try alert on the previous page.

    reply
    0
  • Cancelreply