0

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>

どんな助けでも大歓迎です。

4

1 に答える 1

2

jQuery Update モジュールを使用できます。

https://drupal.stackexchange.com/questions/28820/how-do-i-update-jquery-to-the-latest-version-i-can-downloadも参照してください

于 2013-10-19T09:49:48.113 に答える