Skip to content Skip to sidebar Skip to footer

Dynamic (2 Levels) Javascript/css Loading Ie6

i am trying to dynamically include js (and css) files into a webpage like this: index.html -> loader_a.js -> a_foo.js, a_bar.js, a_foo.css and so on. While this works without

Solution 1:

You need to use document.write in ie, in order to load scripts in parallel.

See: Loading Scripts Without Blocking

I have such a script btw: Loading Multiple Javascript Files In Order Asynchronously

(it may need some enchancements in Chrome)


UPDATE

There is a callback function, it is optional. It can be used to couple dependent script to the files. EG:

functionmyjQueryCode() {
   // ...
}

include(['jquery.js','jquery-ui.js'], myjQueryCode);

So that your jquery dependent code will run after the files has been loaded.

Post a Comment for "Dynamic (2 Levels) Javascript/css Loading Ie6"