方法一:
1,在你的主题文件夹内创建一个scripts.js 文件
2,编辑你主题的info文件,添加下面这行
scripts[] = scripts.js
3,清除缓存或者访问Administer > Site building > Themes 即可。
方法二:
为某个模块使用特定的js文件
drupal_add_js(drupal_get_path('module', 'mymodule') .'/my_js_file.js');
为某个主题使用特定的js文件
drupal_add_js(drupal_get_path('theme', 'mytheme') .'/my_js_file.js', 'theme');
其中mymodule,mytheme为你模块/主题名
153



被折叠的 条评论
为什么被折叠?



