Sys.ScriptLoadFailedException when adding ScriptReferences
I added a manual ScriptReference to an embedded resource but was receiving a client side error:
Error: Sys.ScriptLoadFailedException: The script <url for script> could not be loaded or does not contain the Sys.Application.notifyScriptLoaded() callback.
I found this post to help with the problem. Ajax now loads the various script files in an asynchronous manner, and it is the responsibility of the script file, when completed to call execute code similar to the following:
if( Sys && Sys.Application ){
Sys.Application.notifyScriptLoaded();
}
The if block might not be required, but if you are using a javascript file outside of Atlas you probably should protect it. However on Luis's site, he missed a casing on the method call notifyScriptLoaded. I'm sure he will get that fixed, but just be aware if you copy and paste. :)