Open the web page on which you wish to perform the ping in your preferred text editor.
Insert the following code between the opening and closing <body> tags of the web page:
var ImageObject = new Image();
ImageObject.src = "http://myserver.com/pic.jpg";
alert('The domain is available.');
Substitute the complete URL of the image hosted on the external domain for the value of ImageObject.src above.
Save and publish your web page. When accessed, it will check to see if the image on the domain returns a height value greater than zero. If it gets a response from the domain, it will cause an alert box to pop up stating that the domain is up and running.
- Photo Credit Stockbyte/Stockbyte/Getty Images