Community Documentation

LABjs: Non-blocking JavaScripts

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

LABjs module integrates LABjs, a JavaScript loader, used by Twitter, Vimeo, examiner.com... 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'.

Comments

Current "Drupal behaviors"

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

Fixed.

Fixed.

www.thongtincongnghe.com is powered by Drupal.

Page status

About this page

Drupal version
Drupal 6.x, Drupal 7.x
Audience
Designers/themers, Programmers, Site administrators

Site Building Guide

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here