【发布时间】:2016-01-15 08:08:08
【问题描述】:
我有一个 jQuery:
$('#gather-facts').html('<script type="text/javascript">function gatherFacts() { var r = new XMLHttpRequest(); r.open("GET", "https://<server>/apps/merge?host=" + (document.title).slice(18,-9), false); r.send(); }; window.onload = gatherFacts;</script>');');
在我的 MediaWiki:Common.js 中工作正常,除了我需要以同步模式运行脚本。
jQuery 有一个异步选项,但我似乎不知道如何将它添加到上面。
当前使用 MediaWiki 1.25.2
【问题讨论】:
-
我想你需要看看这个链接:What is the X/Y problem
-
现在您添加了缺失的信息!!!所以你正在执行 AJAX。请准确显示一堆东西在做什么,以便我们为您提供帮助。我非常接近以 How do I return the response from an asynchronous call? 的副本结束这个问题
-
不错,更新了问题