I was porting samples from ASP.NET AJAX Beta 1 to Beta 2 today and ran into a problem that I suspect others will run into, too. A custom script file that loaded fine in Beta 1 wouldn't load in Beta 2. Turns out that Beta 2 adds a new requirement to custom script files for Safari compatibility: the files have to have a callback function named Sys.Application.notifyScriptLoaded. The function doesn't have to do anything, but it does have to be defined. So, simply add the following line to any custom JS files that you load into your ASP.NET AJAX apps:
Of course, this will cause a script error if the JS file is used outside of ASP.NET AJAX. To make the script file work with or without ASP.NET AJAX, use this line:
if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
Other than that, I've encountered few problems getting my Beta 1 code to run in Beta 2.
On Nov 13 2006 3:19 PMBy jprosise