Created
March 14, 2011 21:22
-
-
Save unscriptable/869917 to your computer and use it in GitHub Desktop.
Opera doesn't fire load events in the same order as the scripts are loaded
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Firefox: | |
script1 executes | |
script1 fires load event | |
script2 executes | |
script2 fires load event | |
script3 executes | |
script3 fires load event | |
Opera: | |
script1 executes | |
script2 executes | |
script2 fires load event | |
script1 fires load event | |
script3 executes | |
script3 fires load event | |
Chrome and Safari work like Firefox. | |
IE does something different, but is similarly predictable as Firefox. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the scripts aren't necessarily loaded in order as it looks in this gist, but their corresponding load events fire immediately afterward -- except in opera.
RequireJS uses addEventListener. I am wondering if i switch the code to use addEventListener() instead of onload if it will just start working.
Interestingly, IE9 behaves similarly to Opera when using addEventListener(). James Burke put in a ticket with the IE9 team, but they haven't responded. So James is testing for attachEvent() first.