I've been developing a website and we use getScript to load all of our javascript files (other than jQuery) so the header of the page is shorter. We have a mechanism in place which allows functions to be executed when the script has downloaded. (Registering a function as a dependency of a file and when that file has been downloaded the callback from the getScript triggers the dependent code)
This all works fine in IE and Firefox 2.5. I recently installed the new version of Firefox (3) and am experiencing an unexpected behavior. It appears that the callback function from a getScript call is executing before the downloaded script has been run. For example: I use get script to download a script containing "function 1". I have a piece of code in another script depending on "function 1", so it gets registered in our listener functionality. The callback from the getScript call for downloading "function 1" triggers the running of the dependent code. This all works in IE and Firefox 2.5 but in Firefox 3 the dependent code is erroring because it can not find "function 1". If I place a delay into the dependent code (1 sec), "function 1" seems to be available and no errors occur. There appears to be an early triggering of the callback in Firefox 3. I believe this is a slight browser incompatibility in the new version of Firefox (3). Has any one experienced this? Is this a known issue? Can a fix be created as it's stopping everything from working for us. Thanks in advance to any one who can offer any help on this!!!