drupal jQuery 1.4 on specific pages

2019-08-08 20:19发布

问题:

jQuery 1.4 breaks various modules and is not ready to replace 1.3.2 wholesale. But on various pages with complex javascript interactions, I need 1.4.

What's a good way to force drupal to use 1.4 on specific pages?

Thanks.

回答1:

Take a look at this post, the author describes replacing a js file using hook_theme_registry_alter and a preprocess function. http://www.mediacurrent.com/blogs/remove-or-replace-jscss-page



回答2:

jquery_update is a great way to get 1.3.2 (up from 1.2.6) on D6. You can then combine this with context to serve a different version on certain pages.



回答3:

Is it possible to edit templates? Or how about create a script that includes jQuery based on the page. Like if your body has the class 1.3.2, then it includes the old version, or if it has the class 1.4 it includes the new one.



标签: jquery drupal