I moved this blog to other domain: https://tech.panshin.me , please update your bookmarks

Monday, May 4, 2009

Checking site status

Checking site status

Checking site status

For this blog I need the image that link to my private web site, but my web site not all time on line so I write javascript that show if my web site on line, and if no so write "My site off line.." become image.

<a id="myWebsiteImgLink" href="http://panshin.no-ip.org">

<img src="http://panshin.no-ip.org/Images/WebsiteImg.jpg" onerror="OnErrorLoadImage(this);"/>

</a>

<script>

function OnErrorLoadImage(img)

{

    document.getElementById('myWebsiteImgLink').href = '#';

    document.getElementById('myWebsiteImgLink').innerHTML = '<strong>My Web Site is Offline Now.</strong>';

}

 

</script>


No comments: