关闭MediaWiki资源加载程序脚本标签中的异步属性

发布于 2025-01-23 11:45:10 字数 77 浏览 3 评论 0原文

我有一个依赖性,我认为MediaWiki Resources的异步加载(特别是JQuery)正在引起问题。有没有办法在媒体上关闭此属性? 。

I have a dependency, and I think the asynchronous loading of MediaWiki resources (jQuery specifically) is causing a problem. Is there a way to switch off this attribute in a MediaWiki setting?enter image description here

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

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

发布评论

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

评论(1

像你 2025-01-30 11:45:10

我通过将Resources/resources.php中的jQuery依赖关系的结构与我要包含的资源复制并将.js文件上传到指定文件夹中的资源来解决此问题。

然后将以下代码添加到localsettings.php

$wgHooks['BeforePageDisplay'][] = function( OutputPage &$out, Skin &$skin ) {
  $out->addModules('mymodule');
  return true;
};

I solved this by copying the structure of a jQuery dependency in resources/Resources.php with the resource I wanted to include and uploaded the .js file to the specified folder.

Then added the following code to LocalSettings.php:

$wgHooks['BeforePageDisplay'][] = function( OutputPage &$out, Skin &$skin ) {
  $out->addModules('mymodule');
  return true;
};
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文