Drupal and jquery
I have turned on jquery-update module for drupal 6, but jQuery was not not loaded, I have checked page source, no jQuery here.
Are there any steps I need to do to load jQuery?
I have copy all jQuery files to the misc
folder.
It just is not loaded by front page开发者_如何学Go
Drupal does not load jQuery unless you add a specific script on a given page using drupal_add_js in a module or your theme. The jQuery files themselves are library files you build upon, and without calling drupal_add_js, do not actually do anything on their own.
Using drupal_add_js
You can also add the .js file in your .info file just make sure to clear cache after you have added the line of code to include the jquery library. i think it is scripts[ ]= file directory/name...like js/jquery.js
You can add your JS
and CSS
files in your .info
file or under .module
file inside the hook_init()
. Do not include outside the function it will break the drupal working.
精彩评论