LAB v1.1.11 released

17 views
Skip to first unread message

getify

unread,
Jan 2, 2011, 12:49:12 AM1/2/11
to LABjs
v1.1.11 available for immediate download.

No new bug fixes, but one new feature: conditional script loading.
The .script() call can now accept a function as a parameter, and it
will be executed immediately to determine what script (if any) should
be loaded for that call. This allows the native construction of
conditional chains, where run-time logic is used to decide what
scripts are ultimately loaded.

Example:

$LAB
.script(function(){
// assuming `_if_IE` defined by host page as true in IE and false in
other browsers
if (_is_IE) {
return "ie.js"; // only if in IE, this script will be loaded
}
else {
return null; // if not in IE, this script call will effectively be
ignored
}
})
.script("script1.js")
.wait();



Enjoy, and let me know if you have any questions or issues.

--Kyle
Reply all
Reply to author
Forward
0 new messages