This project is read-only.
1
Vote

Loader doesn't check loaded script ready state

description

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){
     
     
    if(scripts!=undefined&&scripts!='undefined'&&scripts!=null){
     ensure({
                   js:     scripts.js, 
                   css:    scripts.css
              },function(){});
    }
}
 
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.

comments