views:

24

answers:

1

Hi,

I would like to start incorporating LABjs into my project but I want to know if there is anyway to conditionally load scripts. For example, something like:

$LAB
   .script('framework.js').wait()
   .script(function(){
       if(es){
          return  'es.js';
       }else{
          return '';
       }
   })

I have not tried this but am sure it will not work. Is there a more elegant way of doing this?

Thanks

A: 

http://blog.getify.com/2010/02/simulated-chaining-in-javascript/

the answer ain't pretty but it's here

Adrian Adkison