Last updated July 25, 2012. Created on March 25, 2011.
Edited by jcisio. Log in to edit this page.

LABjs module integrates LABjs, a JavaScript loader, used by Twitter, Vimeo, which loads (and executes) all scripts in parallel as fast as the browser will allow. With LABjs, your web page does not need to wait for fetching and executing JavaScript before it renders the page elements.

In general, if you want to embed your scripts, use the $LAB.queue() syntax. It's mandatory if your scripts depend on drupal.js or jQuery. Don't use the native $LAB.script() or $LAB.wait() syntax.

Don't use the document.ready() event, use Drupal behaviors instead. If you prefer to bind to an event, then bind to 'scripts-ready' (a LABjs custom event, fires when all scripts are executed) instead of 'domready'.

Looking for support? Visit the forums, or join #drupal-support in IRC.


int_ua’s picture

Current "Drupal behaviors" link leads to a closed page, can someone fix it?

jcisio’s picture