drupal jQuery 1.4 on specific pages

强颜欢笑 提交于 2019-12-05 16:38:00

In the MYMODULE_preprocess_page function, the $scripts variable contains an array with the information about all JavaScript that will be added to the page.

If you want to remove a JS file from the page, you should remove its entry from the $scripts array (and then update $variables['scripts']). That's what the unset function is doing .

If the jQuery you're trying to remove is the one that's shipped with Drupal, you can remove it with:

unset($scripts['core']['misc/jquery.js']);

Otherwise, you'll have to print_r the $scripts var in order to find the entry you need to remove.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!