我想在火狐扩展中包含jQuery。
我添加了以下代码行来导入jQuery文件:
Components.utils.import("resource://js/jquery.js", window.content.document);Firefox在导入后立即运行该文件。带有匿名闭包的jQuery文件如下所示:
(function( window, undefined ) {
...bunch of code....
_jQuery = window.jQuery,
})(window);当扩展运行时,会出现错误"window is not defined“。授予jQuery对窗口的访问权限的方法是什么?
发布于 2011-02-19 16:42:17
将此代码写入您的*.xul文件以包含jQuery。
<script type="application/x-javascript" src="toolbar.js"></script>https://stackoverflow.com/questions/4137353
复制相似问题