Created
October 23, 2012 13:00
-
-
Save knibals/3938599 to your computer and use it in GitHub Desktop.
Retrieve jQuery from CDN (hook_js_alter)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_js_alter(). | |
*/ | |
function YOUR_THEME_js_alter(&$js) { | |
if (isset($js['misc/jquery.js'])) { | |
$jquery_path = 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js'; | |
$js['misc/jquery.js']['data'] = $jquery_path; | |
$js['misc/jquery.js']['version'] = '1.8.0'; | |
$js['misc/jquery.js']['type'] = 'external'; | |
} | |
} | |
// from http://kahthong.com/2011/12/use-cdn-jquery-your-drupal-theme |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment