javascript - 犀牛中的jquery

标签 javascript jquery rhino

我正在尝试将 jquery 加载到 Rhino 中,如此链接所示 here .但我不断收到以下错误:

line 1086: uncaught JavaScript runtime exception: TypeError: Cannot call method "importNode" of null

我认为是 jQuery 无法完全加载 - 但我不知道为什么。我使用的是作者在源代码管理中发布的相同 index.html 文件。

这是我的 Rhino 控制台的轨迹:

js> load( "/temp/env.js" );
js> window.location = '/temp/index.html';
/temp/index.html
js> load( "/temp/jquery.js" );
js: "/temp/jquery.js", line 1086: uncaught JavaScript runtime exception: TypeError: Cannot call method "importNode" of null
    at /temp/jquery.js:1086
    at /temp/jquery.js:1079
    at /temp/jquery.js:16
    at <stdin>:41

有什么想法吗?

最佳答案

我使用的是 OLD 版本的 env.js 文件。事实证明,作者真的用它跑了,把它移到了它自己的网站上,等等。

新内容是here .

我一开始使用它就对 jQuery 1.5 非常满意。

关于javascript - 犀牛中的jquery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5089022/

相关文章:

c# - 在单元测试期间如何访问基类的 protected 成员?

javascript - 以编程方式从 Raphael.JS 图像生成 PNG

javascript - 如何在类上设置实时事件监听器以根据其内容调整大小自动调整其高度?

javascript - <picture/> 元素 onLoad 没有持续触发

javascript - 为对象创建 html 模板

用于链接到图像的 jQuery 选择器,可以容忍查询字符串

javascript - JQuery 自定义灯箱 - 不透明度淡入淡出

javascript - 如何在 OpenLayers 4 上使用 SVG 图像作为图层

javascript - 在函数中使用 preventDefault() 的问题

java - 从 Java/Scala 实例化 Rhinoscript native 对象