Is there any way to check reachability test of server in jQuery

后端 未结 2 1282
眼角桃花
眼角桃花 2020-12-05 16:36

Is there any way to check reachability test of server .If application not able to connect server then it show a alert? is there any thing method to check.. I check the inter

2条回答
  •  抹茶落季
    2020-12-05 17:04

    One hacky way that should work would be to load an image (or font, style, javascript) from the server and check whether or not that image loads. This method would of course only work as long as there is something to load from the server that is not restricted by CORS policies.

提交回复
热议问题