search

Home  >  Q&A  >  body text

javascript - When the app loads the web page URL, how to determine whether the loading is successful through js?

Now is a situation. When the app loads the page url, when the network error occurs during the loading process, the page cannot be loaded or it takes a long time to load due to network problems. How to judge such a situation through js and then give the corresponding prompt? , if successful, the page will be loaded normally.

世界只因有你世界只因有你2795 days ago467

reply all(1)I'll reply

  • 某草草

    某草草2017-05-19 10:15:08

    Can be used window.onload

    or get HTTP status code

    reply
    0
  • Cancelreply