简体   繁体   English

Drupal 7.87 是否支持 JQuery 3.6.x

[英]Does Drupal 7.87 support JQuery 3.6.x

I am trying to update jQuery for Drupal 7.87 to version 3.6.x.我正在尝试将 Drupal 7.87 的 jQuery 更新到版本 3.6.x。 The jQuery_update module (7.x-3.0-alpha5)installed and the highest JQuery version I can pick from the dropdown list is 3.3.已安装 jQuery_update 模块(7.x-3.0-alpha5),我可以从下拉列表中选择的最高 JQuery 版本是 3.3。

Does anyone know if Drupal 7.87 support JQuery 3.6.x?有谁知道 Drupal 7.87 是否支持 JQuery 3.6.x? If yes, how can I upgrade it properly?如果是,我该如何正确升级它?

Thanks谢谢

The module jquery_update allows to use "recent" versions of jQuery within Drupal but does not provide the latest versions because the changes tend to break Drupal 7 core JS.模块jquery_update允许在 Drupal 中使用 jQuery 的“最新”版本,但不提供最新版本,因为更改往往会破坏 Drupal 7 核 JS。

A solution is to "side load" the newer version using the module jQuery Multi :一种解决方案是使用模块jQuery Multi来“侧载”较新版本:

jQuery Multi allows you to load an extra version of the jQuery library in parallel to Drupal's version, without conflicting with Drupal's version. jQuery Multi 允许您与 Drupal 的版本并行加载 jQuery 库的额外版本,而不会与 Drupal 的版本冲突。

For instance, if you're loading jQuery-3.6.0, the alias will be jq360 , and you can use it in your scripts by wrapping your code as follows:例如,如果您正在加载 jQuery-3.6.0,别名将为jq360 ,您可以通过如下包装代码在脚本中使用它:

(function($){
  // Code here 
  // ....
})(jq360)

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

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