When I did some test cases with LABjs,I encountered some problems,here comes the code:
$LAB.script('http://code.jquery.com/jquery-1.8.0.min.js')
.script('http://id.qq.com/js/10001/simple.js');
according to the API description, there is no guaranteed for the excution order of jquery-1.8.0.min.js and simple.js. I blocked jquery-1.8.0.min.js with fiddler,what i boserverd was:
- It works just all right in IE8, when simple.js finished downloading,it excuted right at once.
- In chrome 20, simple.js never excuted until jquery-1.8.0.min.js finished downloading and excuted.
Is it a bug ?
Then I did another test in chrome 20,here comes the code:
var script = document.createElement('script');
script.type = 'text/cache';
script.src = 'http://code.jquery.com/jquery-1.8.0.min.js';
document.head.appendChild(script);
jquery-1.8.0.min.js didn't start downloading when I ran this code , is it the problem?
here is the api description:http://labjs.com/documentation.php#script