On Sat, Mar 5, 2011 at 12:32 PM, Jarek Foksa <[email protected]> wrote:

> What's wrong with my original loadScript() function? I was scratching
> my head for several hours but I still don't get it why it doesn't work
> correctly on Safari.


What's happening is that when scripts are dynamically injected, browsers
download them asynchronously, in parallel, so script-2.js might finish
downloading before script-1.js. Firefox and Opera will still execute them in
the right order when this happens, but other browsers will execute them
immediately as they come in, regardless of the order they were inserted into
the document.

I'm actually not sure why you say Chrome seems to be working, because it
shouldn't be. Might just be blind luck.

This is one of the things a good script loader will handle for you.

- Ryan

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to