Quote:
Originally Posted by AndrewGSW
@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.