我尝试按照MediaWiki.org上的教程使用用户脚本自定义工具栏;但是,有时当我从 加载它时common.js
,我会在控制台中收到此错误:
jQuery.Deferred exception: $(...).wikiEditor is not a function TypeError: $(...).wikiEditor is not a function
at quickMAR_add (https://en.moegirl.org/index.php?title=User:Leranjun/quickMAR.js&action=raw&ctype=text/javascript:52:19)
at https://en.moegirl.org/index.php?title=User:Leranjun/quickMAR.js&action=raw&ctype=text/javascript:60:12
at mightThrow (https://en.moegirl.org/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=1o54dq6:49:598)
at process (https://en.moegirl.org/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=1o54dq6:50:269) undefined
更奇怪的是,它有时有效,有时无效……如果我将代码复制/粘贴到控制台并手动执行,它总是有效。
源代码在这里,如果有必要的话。