Hi,
Does anybody know how to prevent the browser from hanging when a Javascript references a script on a remote server, in the case when the remote server is unavailable or down.
For example, we offer the following script as a free service, but if our server is down or isolated from the network, then the script not only ceases to operate, but blocks the loading of the entire page that it is on.
// To display the national flag of
// the viewer's country.
<script language="Javascript" src=http://www.webdeveloper.com/forum/archive/index.php/"http://map.geoup.com/geoup?template=flag"></script>
What would be really cool, would be if we could fail gracefully or load the script src from an alternate server. As a minimum, we would like to at least be able to let the page continue loading.
BTW, I am not sure if it is relevant or not, but the script does not always load an image, as in the flag above, it can also be used to return a phrase - as in
<script language="Javascript" src="http://map.geoup.com/geoup?template=welcome"></script>
which displays a localized welcome message which refers to the viewers city.
Any ideas?
Kind Regards
Russell Turner
Geobytes, inc.
<!-- m --><a class="postlink" href="http://www.geobytes.com/">http://www.geobytes.com/</a><!-- m -->
Geobytes - because everybody's somewhere!
Does anybody know how to prevent the browser from hanging when a Javascript references a script on a remote server, in the case when the remote server is unavailable or down.
For example, we offer the following script as a free service, but if our server is down or isolated from the network, then the script not only ceases to operate, but blocks the loading of the entire page that it is on.
// To display the national flag of
// the viewer's country.
<script language="Javascript" src=http://www.webdeveloper.com/forum/archive/index.php/"http://map.geoup.com/geoup?template=flag"></script>
What would be really cool, would be if we could fail gracefully or load the script src from an alternate server. As a minimum, we would like to at least be able to let the page continue loading.
BTW, I am not sure if it is relevant or not, but the script does not always load an image, as in the flag above, it can also be used to return a phrase - as in
<script language="Javascript" src="http://map.geoup.com/geoup?template=welcome"></script>
which displays a localized welcome message which refers to the viewers city.
Any ideas?
Kind Regards
Russell Turner
Geobytes, inc.
<!-- m --><a class="postlink" href="http://www.geobytes.com/">http://www.geobytes.com/</a><!-- m -->
Geobytes - because everybody's somewhere!