getify
unread,Jan 2, 2011, 12:49:12 AM1/2/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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