Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-21-2008, 04:39 AM   PM User | #1
morgansolutions
New to the CF scene

 
Join Date: Feb 2008
Location: North Wales
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
morgansolutions is an unknown quantity at this point
How do I Ping in JavaScript?

Hi

I'm new to JavaScript and am still trying to grasp the basics. However, I need to create something which could be quite complex and am beginning to wonder if JavaScript may not be the right language to use for the task.

At work, I find myself pinging all the time - in fact it is quite often the case that I'll have in excess of 30 pings running to different terminals worldwide simultaneously. To make life easier, I'd like to create a script where I can run nermerous pings side by side (rather then opening a new command prompt for each ping!) I'd also like to have some notification once the connection is live, maybe a system bleep for example to grab my attention, and also a display of how long the connection has been alive for (so I can determine whether or not it's worth connecting to the terminal or if it's still booting up!)

Anyway pointers would be gratefully appreciated.
morgansolutions is offline   Reply With Quote
Old 07-21-2008, 07:50 AM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,033
Thanks: 197
Thanked 2,410 Times in 2,388 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Sorry, no... JS isn't capable of anything like this unless the host
(usually a browser, but not necessarily) provides some interface to do
it.

It is possible to ping a specific image:-

See:-

http://www.webmasterworld.com/forum91/2420.htm

http://www.chronosight.net/view/2007...t-to-ping.html

Last edited by Philip M; 07-21-2008 at 08:00 AM..
Philip M is offline   Reply With Quote
Users who have thanked Philip M for this post:
morgansolutions (07-22-2008)
Old 07-21-2008, 08:23 AM   PM User | #3
rnd me
Senior Coder

 
rnd me's Avatar
 
Join Date: Jun 2007
Location: Urbana
Posts: 3,452
Thanks: 9
Thanked 466 Times in 450 Posts
rnd me is a jewel in the roughrnd me is a jewel in the roughrnd me is a jewel in the rough
you can only make connections to a server on your own domain.

you can use a synchronous HEAD request to contact your server with just one packet coming back, essentially a beefy ping, and able to be timed as well.

and like philip m said, if you can find an image on the remote server, you can cross domains and verify status by checking the height of the image once it loads.
__________________
my site (updated 5/13)
STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.8% IE9:11.4% IE10:6.5%
rnd me is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:53 PM.


Advertisement
Log in to turn off these ads.