[development] Drupal 7 API Change notification: JavaScript loading techniques (use drupal_add_library())

Randy Fay randy at randyfay.com
Sun Dec 12 21:22:28 UTC 2010


*We try to notify this list when API changes are made in Drupal 7, so
contrib and custom developers have a chance to fix their code before they
have the pain of figuring out why it's broken.
*
(issue <http://drupal.org/node/954804>) Contrib modules should not use
drupal_add_js() for core JavaScript files (which are all now packaged as
libraries). Instead, use drupal_add_library(). Failure to do this can mess
up the weighting of javascript files. This is true of any JS file that is
included in a library: use the library to load it.

You may also be interested in general JS/CSS
loading<http://drupal.org/update/modules/6/7#js_css_loading_change>upgrade
information, and also in the D7
Javascript Handbook Page <http://drupal.org/node/756722>.

Thanks,
-Randy

-- 
Randy Fay
Drupal Module and Site Development
randy at randyfay.com
+1  970.462.7450
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20101212/c29afbc6/attachment.html 


More information about the development mailing list