Home  >  Q&A  >  body text

javascript - After entering the page from the menu in WeChat web development, pressing the return key does not close the browser but refreshes the current page. Any solution?

I am currently developing a public account, and I am doing a spa. After entering the public account from the menu, for example, entering the A page, pressing the return key does not exit the web page, but refreshes the A page, resulting in a very poor experience, but I see other people The public accounts are all exiting the web page. I guess the reason is caused by WeChat authorization redirection. Because I copied the link after pressing return and the link before redirection are the same every time. The current requirement is that when pressing the return key, if the link is consistent with the link before redirection, exit the webpage directly instead of refreshing the page. Seek solutions. urgent! ! !

阿神阿神2690 days ago883

reply all(1)I'll reply

  • 扔个三星炸死你

    扔个三星炸死你2017-06-30 09:59:38

    Listen to the popstate event, and if the link is consistent with the link before redirection, execute the exit operation of jssdk

    reply
    0
  • Cancelreply