I asked this a while back and got zero response and came to the conclusion that with JS alone there is no way. However, you can use PHP to determine if the site is available and do a document.write based on your findings. Similarly (though slightly more complex) you can do it via a perl SSI script.
<edit> Oh yes. Undert 'normal' security settings, this can only be used to load¦test a document within the same domain. If you need to test for a page outside you own domain, then you will need some kind of server-side solution (possibly using server-side XMLHTTPRequest). </edit>
Internet routing issues make what you're asking for problematic at best. Just because you can connect from your IP address doesn't mean the visitor can connect, vice versa if you can't connect it doesn't mean the site isn't up and running and available to your visitor.