Computing.Net > Forums > Web Development > JavaScript - Ping Computer

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to get for your free account now!

JavaScript - Ping Computer

Reply to Message Icon

Name: RTAdams89
Date: April 7, 2005 at 16:47:15 Pacific
OS: XP Home SP2
CPU/Ram: Pentium 4 2.53GHz / 512MB
Comment:

Hello all. Is there any way to use javascript to ping an IP address? Please note that I need to be able to determine if a computer (ip address) is on-line with out that computer runnign a web server or such.

-Ryan Adams


Report Offensive Message For Removal

Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: April 7, 2005 at 16:58:40 Pacific
Reply:

You can't do it through client-side sript. And even with server-side script (if your host handles that) I don't know of a way to do it. I think a more robust server-side scripting language, such as VBScript or PHP, might be able to do it.

Michael J


Report Offensive Follow Up For Removal

Response Number 2
Name: Laler
Date: April 7, 2005 at 17:38:44 Pacific
Reply:

and if it's personal computers then I think the default settings of XP SP2 and other standard firewall is ignoring icmps? so it's a bit unreliable...

so, without asking them to install a webserver, you can also check for IMs the computer use, there're some tutorials on doing this (testing if someone's Y!m, AOL, MSN, ICQ is online)...

you still need serverside scripting though

---
Site of the Day


Report Offensive Follow Up For Removal

Response Number 3
Name: RTAdams89
Date: April 7, 2005 at 17:43:45 Pacific
Reply:

Well it's for my home network. I have a web page stored on a network drive that all the other PCs access as their homepage. I want to incorperate a script into the webpage that will show which of my PCs are curently connected. Perhaps a Java applet?

-Ryan Adams


Report Offensive Follow Up For Removal

Response Number 4
Name: Laler
Date: April 7, 2005 at 18:45:47 Pacific
Reply:

this homepage is in a webserver or just a html page in a network drive? if it's a webserver (and nothing much to lose to install one) then enable php in it, only 1MB for the IIS webserver (standard server found in win XP CD)...

it'll be more resource friendly than a java applet and lots of people here can help you with the ping script (as now icmp ignoring is no longer an issue)

:D

---
Site of the Day


Report Offensive Follow Up For Removal

Response Number 5
Name: Michael J (by mjdamato)
Date: April 7, 2005 at 21:45:51 Pacific
Reply:

I'd suggest the same thing. Either install PHP or IIS (which allows ASP (server-side VBScript and JavaScript)

I actually started the same kind of thing a while back but got side tracked. I have a page on my home webserver that has an icon for each of the computers in my home that shows if the computer is on or not. If it is on, I was going to have a link to Remote Desktop to the computer. This was in VBScript. I'll see if I can did anything up.


Michael J


Report Offensive Follow Up For Removal

Related Posts

See More



Response Number 6
Name: Michael J (by mjdamato)
Date: April 7, 2005 at 22:11:00 Pacific
Reply:

Ok, here are a couple of resources:

Article Ping From ASP This is a tutorial using a batch file with ASP

This is a download of a DLL file that will allow you to ping within VBScript without an external bat file.

But WAIT! I just had another idea. Why don't you just create a folder on each computer with an image (I'd use a transparetn GIF). Then map each of those folders to your server. Then your HTML page could try to load each of the images - there is a javascript onError event handler to tell if there was an error loading an image. You could use that as the trigger to determine if the computer was on or not. Just put the following into the image tag "onError='js function or code'"

Michael J


Report Offensive Follow Up For Removal

Response Number 7
Name: Laler
Date: April 7, 2005 at 22:19:33 Pacific
Reply:

/snip
But WAIT!
/snip

I second, that's a great idea :D

---
Site of the Day


Report Offensive Follow Up For Removal

Response Number 8
Name: Michael J (by mjdamato)
Date: April 8, 2005 at 01:34:38 Pacific
Reply:

Just shows that it's important to provide as much detail as possible. Had we known that he was trying to ping local computers, this could have been a much shorter thread.

Michael J


Report Offensive Follow Up For Removal

Response Number 9
Name: RTAdams89
Date: April 8, 2005 at 06:43:35 Pacific
Reply:

Well like I said it's on a network drive (a Linksys NSLU2) which is not a computer and can't run a web server or such on it. I was going to use the image idea originally, however, will javascript work ok if the image URL is actually network link ( such as "\\computername\shared\")?

-Ryan Adams


Report Offensive Follow Up For Removal

Response Number 10
Name: Jamie_McCoy
Date: April 8, 2005 at 08:00:39 Pacific

Response Number 11
Name: Jamie_McCoy
Date: April 11, 2005 at 20:00:19 Pacific
Reply:

http://uk.php.net/manual/en/function.system.php

bt more info

roamhosting.net


Report Offensive Follow Up For Removal
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: JavaScript - Ping Computer

check accessiblity of this site. www.computing.net/answers/webdevel/check-accessiblity-of-this-site/2072.html

Using Javascript to determine... www.computing.net/answers/webdevel/using-javascript-to-determine/2683.html

javascript onclick add member www.computing.net/answers/webdevel/javascript-onclick-add-member/2028.html