I don't know what the correct syntax is for HTML5 or if this even works the way I remember, but I was of the understanding that if the source file pointed to by the src attribute of the script tag was not found, the code between the tags is run instead. For instance:

But as long as you're loading jQuery from a local source, the issue should never come up. If you're having trouble loading jQuery, it probably means the 'src' attribute is malformed. Since you're using relative addressing in your example, make sure that the file exists on the server and then try using a complete URL instead (ie. 'http://www.example.com/script/jquery.js') in the 'src' attribute.

05-19-2014, 09:15 PM

dseabroo

I believe this solution is specific to JQuery. Is there a general solution for detecting the inclusion of .js file?