search

Home  >  Q&A  >  body text

javascript - How does the page get the redirected url?

I recently encountered a problem, window.location.href='url', and then I found that the url redirected to another address. Can I prevent the execution of window.location.href? I only need to get the redirection. Then the parameters in the url.

滿天的星座滿天的星座2701 days ago1021

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-07-03 11:44:39

    Page switching will trigger window.onunload You can just stop it inside

    At the same time, your new url is a value assigned in your code, there is no such thing as acquisition. You know your code itself, right?

    reply
    0
  • Cancelreply