View Single Post
Old 11-14-2012, 11:25 AM   PM User | #8
rnd me
Senior Coder

 
rnd me's Avatar
 
Join Date: Jun 2007
Location: Urbana
Posts: 3,455
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
Quote:
Originally Posted by AndrewGSW View Post
@rnd me: Thank you.

A little search tells me that ping-ing notifies a server of changes to a web page (or site).

This seems (to me) to be almost accidental, as it's original purpose - from the command line - was to test a connection, receiving a detailed response. I gather that the response itself is usually ignored, as simply receiving any response is sufficient to confirm the connection as 'active'.
no, this simply tries to load the front page of the IP address, regardless of if it changed or not. you won't get any feedback in js with the above script, though the site can feel it.

if the site is not one you control, it's more difficult to tell exactly what's going on with its content, or even if it's online.

one "hack" is using a known image url to see if the site is online. you load an image at the url and wait to see if the load() or error() fires. if error() fires, the server is offline.

if the server emits access-control headers, you can use ajax to fetch the url and inspect the content for changes yourself.


finally, it is VERY practical and possible to use "timing attacks" and error messages to determine if a site is on or offline. various incarnations of this use hidden iframe load events, img ping timeouts, and certain subtle differences in some javascript-reported URL-based error messages between status 200, 404, and no response at all. i won't go into details here, but the info is out there if you need it.
__________________
my site (updated 5/13)
STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.6% IE9:9.8% IE10:10%
rnd me is offline   Reply With Quote