Is it possible to ping a server from Javascript?

后端 未结 17 933
礼貌的吻别
礼貌的吻别 2020-11-22 04:02

I\'m making a web app that requires that I check to see if remote servers are online or not. When I run it from the command line, my page load goes up to a full 60s (for 8 e

17条回答
  •  一生所求
    2020-11-22 04:56

    It might be a lot easier than all that. If you want your page to load then check on the availability or content of some foreign page to trigger other web page activity, you could do it using only javascript and php like this.

    yourpage.php

    
    
    
      mypage html content
      ...
    
    
    

    That should do it.

    The triggered javascript should include clearInterval(stopmelater)

    Let me know if that works for you

    Jerry

提交回复
热议问题