开发者

How do I ping a server 100k times via javascript?

开发者 https://www.devze.com 2023-02-20 12:39 出处:网络
I have a website that keeps going up and down, and I never know when it\'s up. I\'d like to be able to constantly ping it so that I can see when it\'s gone down.

I have a website that keeps going up and down, and I never know when it's up. I'd like to be able to constantly ping it so that I can see when it's gone down.

Step 1 is to get the ping w开发者_StackOverfloworking.

Step 2 is to take the results when they time out and send a message to my pager.

I'm only interested in step 1 right now.

Would javascript or flex be the best way?

Thanks


You might just want to try a service like: http://www.pingdom.com/, they'll do all that for you.


You might want to put a small xml file on your website like

<root>
 <result>ok</result>
</root>

Then you try to load the xml file with jquery, check if you get your "ok" or if you get an error or a timeout.

Jquery doc: http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings

0

精彩评论

暂无评论...
验证码 换一张
取 消