繁体   English   中英

如何在drupal7中更新jQuery

[英]How to update jQuery in drupal7

我正在尝试将我的drupal jquery1.4更新为jquery1.8。 我尝试使用以下方式。

  function oxavd_js_alter(&$javascript) {
  //We define the path of our new jquery core file
  //assuming we are using the minified version 1.8
  $jquery_path = drupal_get_path('theme','oxavd') . '/js/jquery-1.8.0.min.js';

 //We duplicate the important information from the Drupal one
 $javascript[$jquery_path] = $javascript['misc/jquery.js'];
 //..and we update the information that we care about
 $javascript[$jquery_path]['version'] = '1.8.0';
 $javascript[$jquery_path]['data'] = $jquery_path;

 //Then we remove the Drupal core version
 unset($javascript['misc/jquery.js']);
}

我从这里提到了这个

但这对我没有用。 它显示版本1.4.4

<script type="text/javascript" src=".../misc/jquery.js?v=1.4.4"></script>

任何帮助,将不胜感激。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM