Share this page 

Detect a site is down and redirectTag(s): JS Varia


A simple way will be to try to load a known small image and you detect if the loading is done or not.
<img src="http://www.rgagnon.com/images/pdf.gif"
   onload="window.location='http://www.rgagnon.com';"
   onerror="window.location='http://www.google.com';"
>
If the pdf.gif is loaded, we switch to the site, if not we go somewhere else.