Solved

Client Ping via Javascript

Posted on 2008-06-25
5
1,582 Views
Last Modified: 2008-06-30
Hello!

I need some way to ping an IP using javascript.  The ping has to come from the client, hence the JS dependency, and it should work just as if the client ran ping from their command prompt.  The solutions I've found work in the case that the pinged computer is running a web server, but when this is not the case the pingers will fail.  Does anyone know of a solution that should work for this?

Thanks!
0
Comment
Question by:RJBuild
  • 2
5 Comments
 
LVL 11

Expert Comment

by:spoxox
ID: 21869297
Any computer can be set up to refuse ping requests.

If you have a solution that works some times, don't bother trying to make it work for every target.
0
 

Author Comment

by:RJBuild
ID: 21869347
The issue is that the solution I have now works only when the server accepts web requests.  For example, I can ping experts-exchange.com via command line or the script, but if I try some location without a web server, the command line succeeds and the web script fails.

For example, google.com will work in both, but try ns.google.com, which succeeds at the command line, fails on the web page as there is no web server there.
0
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 500 total points
ID: 21904506
This can't be done just with Javascript.  If you want something that can work in any browser then look at making or finding an applet.  For example a Java applet.  If just an IE solution is sufficient then you could look at an ActiveX object.  The browser itself can't use clientside script to do this, especially based on the client.

Browser security does limit even applets and objects but they can do more if the user is willing to allow them to be downloaded or run.  Most of the times this is a one time warning.  A signed applet or object will be able to do more so you might have to have yours signed if you develop it yourself.

I don't know of a premade applet that will do this, which I could trust.  A google search will offer a number of results.  I'll be happy to try to help you find one if I can but I would recommend making your own, especially if this is something you will distribute to users/visitors and want them to trust.

Let me know if you have question or need more info.

bol
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 21904578
I'm glad I could help.  Thanks for the grade, the points and the fun question.

bol
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Html fieldset fix its height and width 4 32
How to resize a div in html 3 38
jQuery force form POST 7 46
How do I show metrics with PHP or Javascript 6 33
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn how to dynamically set the form action using jQuery.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question