Forum Moderators: open
The problem is, I'm calling the source from another server (and the javascript has to be on this other server).
What can I do if that other server goes down?
I don't want users to experience errors or strange behavior. At the very least, it would be nice to give them an error message or simply skip the script.
I've read all the documentation, and nothing worked (supposedly code placed between the script tags will execute on error, but it doesn't work if the
other web server is down).
I'm hoping someone on this list has found a workaround.
Thanks,
Cheers
Klaus
Ex:
<script src="http://someserver/script.js" type="text/javascript"></script>
var exists = "yes";
then something like this in the page loading it:
<script type="text/javascript">
var exists = "no"; // default until external loaded
</script><script src="http://someserver/script.js" type="text/javascript"></script>
<script type="text/javascript">
if (exists == "no") {
// it didn't load, better do something else!
}
</script>
J.