PDA

View Full Version : Ext.Loader, examples?



hello2008
25 Aug 2010, 8:21 PM
looks like Ext.Loader is added into ExtCore when ext 3.3.0 beta is out, but nothing mentioned about this new feature? I need several examples to get familiar with this function.

44gatti
26 Aug 2010, 6:25 AM
It seems a beta feature for now.
I use Lab.js. (nonblocking JavaScript loading library)
http://labjs.com/documentation.php
try this! ;)

Examples:


//import script
<script type="text/javascript" src="js/path/LAB.js"></script>
//1:
$LAB.script("js/path/1.js").wait(this.yourcallback.createDelegate(this));

//2:
$LAB.setOptions({AlwaysPreserveOrder:true,BasePath:"js/path/"})
.script("1.js","2.js","3.js") //parallel loading, not preserve order
.script("4.js") //wait for 1,2,3 loading completion then load 4
.script("5.js") //wait for 1,2,3.js 4.js completion thsn load 5
.script("6.js","7.js")//wait .. completion and parallel loading of 6,7
.wait(yourcallback);
...
I Hope this helps.

hello2008
26 Aug 2010, 8:58 AM
@44gatti
thanks, LABjs is so cool, I will look into it ;)

44gatti
27 Aug 2010, 10:39 AM
thanks to Kyle Simpson (author) and Nikolas Zakas (YUI) books .. ;)

ashaihullin
2 Sep 2010, 12:39 AM
yep, LAB works fine...

44gatti
3 Sep 2010, 4:06 AM
Only a simple note, in many cases debugging dinamically loaded files with Lab.js it's not the same as debugging static loaded files.
I suggest to wrap the loading statements in a try /catch block to catch exceptions.

hello2008
6 Sep 2010, 2:14 AM
thanks for your helpful note ;)

44gatti
7 Sep 2010, 5:41 AM
Kyle Simpson (alias Getify) suggests me Dominoes for load JS and CSS.
http://code.google.com/p/javascript-dominoes/
It has been specifically tested with:


Internet Explorer 8
Firefox 3.5
Safari 4
Chrome 3
Opera 9

I'll take a look!

Other libraries-->
http://github.com/rgrove/lazyload/
http://developer.yahoo.com/yui/get/

hello2008
9 Sep 2010, 7:42 AM
cool, thanks for your links, you always give us good resources ;)