I have an HTML page which calls a few javascript libraries using the "script" tag.
One of these is actually provided by another server which occasionally crashes and thus reports a "STATUS 404 NOT FOUND".
The advantage of using this server is that it is faster than mine and loads the libary in about 200 miliseconds whereas when it is on my server is takes about 2 seconds. However, I would like to keep a copy on my server and only load it when the browser reports a Status 404.
But how do I program that in javascript?
function LoadLib(){
if (server status == 404)
{load library 1}
else
{load library 2}
}
Something along these lines?
Anyone done this before?