【问题标题】:How to update jQuery in drupal7如何在 drupal 7 中更新 jQuery
【发布时间】:2013-10-19 09:38:01
【问题描述】:

我正在尝试将我的 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']);
}

我从here 提到了这个

但这对我不起作用。 它显示版本 1.4.4

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

任何帮助将不胜感激。

【问题讨论】:

    标签: jquery drupal drupal-7


    【解决方案1】:
    猜你喜欢
    • 2014-03-26
    • 2012-06-17
    • 1970-01-01
    • 1970-01-01
    • 2011-06-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多