[英]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.