Quantcast
Viewing latest article 1
Browse Latest Browse All 2

Upgrading Drupal to use jQuery 1.8

jQuery 1.8.0 has been released! It has probably been brought to your attention a billion times by now. :) Sadly, Drupal by default loads jQuery 1.4. :( But no worries, I'm gonna show you how to use jQuery 1.8 in your Drupal 7 theme without installing any crazy modules. :)
function ThemeName_js_alter(&$js) {
  $js['misc/jquery.js']['data'] = drupal_get_path('theme', 'ThemeName') . '/path/to/jquery-1.8.0.min.js';
}
Done! Now clear your cache (drush cc registry) and check it out! You are now using jQuery 1.8. That's really important if you are going to use Twitter Bootstrap, as it requires > jQuery 1.7.

Important Note

By upgrading jQuery from 1.4, you may find that some aspects of contrib modules will not work properly. For instance, some parts of Views UI will be broken. Especially if you intend on using your theme as an administration theme, you may want to consider using jQuery in noConflict() mode.

Viewing latest article 1
Browse Latest Browse All 2

Trending Articles