This project is read-only.

Loader doesn't check loaded script ready state


So recently i tried ensure. I use it in ajax application.
I load all scripts on demand and here is example where ensure is not good enough.
-Button start xmlhttprequest (jquery $.ajax)
  • php application make her stuff also generate "must load" array of scripts
  • json is returned to javascript with list of javascript and stylesheet for load
    function load_on_demand_scripts(scripts){
                   js:     scripts.js, 
                   css:    scripts.css
Fiddler show me that all is loaded, BUT..
First js in list is (eg. jquery.dynatree.js)
Second js is file with javascript code which use code in previusly loaded.
Second file return eg. dynatree is not function.
When i put some big delay between scripts loading then all work fine.
Sorry for my bad english.