Forum Moderators: open
Not everyone takes our advice - recently the server went down and in effect stopped a lot of web sites from loading.
Is there a way to force the javascript to timeout and allow the sites to load if our server is down?
Any thoughts?
-s-
I think that most browsers support two event handlers onload and onerror that could be used to check whether an image from a your server is loadable and react to it.
<SCRIPT>
var testServer= new Image();
testServer.onload = function(){//pop up pop-up}
testServer.onerror = function(){//doSomeOtherStuff server, try another }
testServer.src = 'http://site/testserver.gif';
</SCRIPT>
So the if image loads you can call you javascript that opens the pop up, otherwise do nowt, or call another server.
[Not tested]