jQuery 更新未替换 Drupal 6.16 中的 js 文件

发布于 2024-09-03 14:36:20 字数 773 浏览 3 评论 0原文

我在 drupal 6.16 中使用 jquery update 以及许多其他模块。

我正在尝试使用 jquery ui 1.7.2 来呈现选项卡。但不幸的是,它们无法正常工作,因为 jquery 更新没有替换 jquery 文件(jquery 1.3.2)。我使用 $.fn.jquery (在 firebug 中)检查了版本,结果得到 1.2.6 (不是所需的 1.3.2) - 正如预期的那样,聚合的 js 文件使用的是 1.2。 jquery 6 版本(参见源代码)。

早些时候,我刚刚将 /misc 中的核心脚本文件替换为 sites/default/modules/jquery_update/replace 文件夹中的 js 文件(就像您在 5.x 中所做的那样)。 x)并得到了必要的结果(我还将 jquery.min.js 重命名为 jquery.js )。

现在,在我升级到 6.x-2.0-alpha1 并安装了 mollom 模块后,它突然停止工作了。禁用/卸载 mollom 或降级 jQuery 更新似乎没有帮助。

但问题只出现在首页。其他内容页面有 jQuery 1.3.2

问题可以在这里看到。

所以,基本上,由于某种原因,jquery update 并没有替换首页上的 jquery 文件(正如它应该的那样)。我不明白为什么会发生这种情况。

有什么想法吗?

I am using jquery update in drupal 6.16 along with a lot of other modules.

I am trying to use jquery ui 1.7.2 to render tabs. But unfortunately they don't work properly since jquery update is not replacing the jquery file (jquery 1.3.2). I checked the version using $.fn.jquery (in firebug) and got 1.2.6 (not 1.3.2 as required) as the result - and as expected the aggregated js file was using the 1.2.6 version of jquery (see source).

earlier I had just replaced the core script files in /misc with the js files in sites/default/modules/jquery_update/replace folder (like you'd do in 5.x) and got the necessary result (i also renamed jquery.min.js to jquery.js ).

now suddenly that stopped working after i upgraded to 6.x-2.0-alpha1 and also installed the mollom module. disabling/uninstalling mollom or down-grading jQuery update does not seem to help.

the problem only occurs on the front page though. other content pages have jQuery 1.3.2

the problem can be seen here.

So, basically, for some reason, jquery update is not replacing the jquery files (as it is supposed to) on the front page. and i cannot figure out why that happens.

any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

思念绕指尖 2024-09-10 14:36:20

以下问题尝试解决更新后的 jquery 未使用的问题。请点击此链接查看整个讨论。

jquery_update.module 文件有问题。

在 jQuery 1.3.2 之前,所有标头信息都采用以下形式:

/*
* jQuery 1.2.6 - New Wave Javascript

jQuery Update 匹配数字以查看它是否应该覆盖 Drupal 包含的 JS 文件。

从 v1.3.2 开始,标头信息现在采用以下形式:

/*
* jQuery JavaScript Library v1.3.2

模式匹配失败,模块恢复为 Drupal 的默认 jQuery 文件。
正确的替换模式应该是:

$pattern = '# \* jQuery JavaScript Library v([0-9\.]+)#';

这个替换应该在文件 jquery_update.module 中完成,第 91 行。

The following issue attempts at solving the problem of an updated jquery not being used. Follow this link to see the whole discussion.

There is a problem with the jquery_update.module file.

Prior to jQuery 1.3.2, all the header information was in the form:

/*
* jQuery 1.2.6 - New Wave Javascript

jQuery Update was matching on the number to see if it should override Drupal's included JS file.

Since v1.3.2, the header information is now in the form:

/*
* jQuery JavaScript Library v1.3.2

The pattern matching fails and the module reverts to Drupal's default jQuery file.
The correct replacement pattern should be:

$pattern = '# \* jQuery JavaScript Library v([0-9\.]+)#';

This replacement should be done in the file jquery_update.module, line 91.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文