- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在我的一个网站中使用名为“Facelift 1.2”的 javascript,虽然该脚本在 Safari 3、4b 和 Opera、OmniWeb 和 Firefox 中有效,但在任何 IE 版本中均无效。但即使在工作浏览器中,我也会收到以下错误,我无法破译。
也许在适当的时候——有了更多 Javascript 方面的经验——我将能够,但现在我想我会问你们中的一些人,在 SO。
以下是我在 IETester 测试 Interet Explorer 6,7 和 8 页面时得到的错误弹出窗口:
以下内容来自 Firefox 3.0.6 的 Firebug 控制台:
网站是:http://www.457cc.co.nz/index.php以防它帮助您看到实际提到的问题。
我也查过第620行对应的是:“第 76 行”是:
this.isCraptastic = (typeof document.body.style.maxHeight=='undefined');
这是此代码块的一部分(取自 flir.js):
// either (options Object, fstyle FLIRStyle Object) or (fstyle FLIRStyle Object)
,init: function(options, fstyle) { // or options for flir style
if(this.isFStyle(options)) { // (fstyle FLIRStyle Object)
this.defaultStyle = options;
}else { // [options Object, fstyle FLIRStyle Object]
if(typeof options != 'undefined')
this.loadOptions(options);
if(typeof fstyle == 'undefined') {
this.defaultStyle = new FLIRStyle();
}else {
if(this.isFStyle(fstyle))
this.defaultStyle = fstyle;
else
this.defaultStyle = new FLIRStyle(fstyle);
}
}
this.calcDPI();
if(this.options.findEmbededFonts)
this.discoverEmbededFonts();
this.isIE = (navigator.userAgent.toLowerCase().indexOf('msie')>-1 && navigator.userAgent.toLowerCase().indexOf('opera')<0);
this.isCraptastic = (typeof document.body.style.maxHeight=='undefined');
if(this.isIE) {
this.flirIERepObj = [];
this.flirIEHovEls = [];
this.flirIEHovStyles = [];
}
}
整个脚本也可以在我的服务器上使用:http://www.457cc.co.nz/facelift-1.2/flir.js
我只是不知道从哪里开始寻找错误,特别是因为它只影响 IE,但在其余部分有效。也许你们有一个想法。我很想听听他们的声音。
感谢阅读。珍妮丝
PS:这是 Opera 的错误控制台报告的内容:
JavaScript - http://www.457cc.co.nz/index.php
Inline script thread
Error:
name: TypeError
message: Statement on line 620: Cannot convert undefined or null to Object
Backtrace:
Line 620 of linked script http://www.457cc.co.nz/facelift-1.2/flir.js
document.body.appendChild(test);
Line 70 of linked script http://www.457cc.co.nz/facelift-1.2/flir.js
this.calcDPI();
Line 2 of inline#1 script in http://www.457cc.co.nz/index.php
FLIR.init();
stacktrace: n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
最佳答案
我同意 tvanfosson 的观点——你得到这个错误的原因很可能是因为你在页面加载完成之前调用了 init()
,所以 document.body
尚未定义。
在您链接的页面中,您应该将以下代码移动到页面底部(就在结束 html 标记之前:
<script type="text/javascript">
FLIR.init({ path: 'http://www.457cc.co.nz/facelift-1.2/' });
FLIR.auto();
</script>
更好的是,您应该将初始化附加到文档的 ready
事件。如果你这样做,甚至不需要将你的 javascript 移动到文件的底部。使用 jquery:
$(document).ready( function(){
FLIR.init({ path: 'http://www.457cc.co.nz/facelift-1.2/' });
FLIR.auto();
});
关于Javascript:错误 'Object Required'。我无法破译它。你可以吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/592420/
我正在尝试用 Python 破译标准的“a = 1, b = 2, c = 3...”密码,但我有点卡住了。我想要解密的消息是“he”——“8 5”,但由于我的 if 语句的顺序,输出是“eh”。有人
所以我正在编辑代码,并且有一段代码完全没有注释,所以我担心对其进行任何更改,这一切都是从这个 while 语句开始的。 有人能破译这个吗?从技术上描述这是在说什么/在做什么,我相信我能弄清楚我理解第一
好的,所以我在 Haskell 中有这段代码: data Bigit = O | I deriving (Show,Eq) add x y = reverse $ addC O (reverse x)
我继承了一个 BASIC 脚本,我正在尝试将其重写为 Python。我不知道 BASIC,甚至不知道这是哪个版本的 BASIC。是 Visual Basic 吗?请帮我翻译这段代码。 'County
我对 puppet 很陌生,只是想了解输出告诉我的内容。我有一个非常简单的 init.pp 文件来配置 shudders 文件: class sudo { package { sudo:
下面这段代码是为了演示一段OSGi代码中可能发生的死锁,直接取自免费下载的书籍:osgi in practice (Neil Bartlett) 。这本书总体上很容易理解,而且我发现它非常有用。但是,
我正在玩 vim-ruby 缩进,那里有一些非常复杂的正则表达式: " Regex used for words that, at the start of a line, add a level o
我继承了一个 BASIC 脚本,我正在尝试将其重写为 Python。我不知道 BASIC,甚至不知道这是哪个版本的 BASIC。是 Visual Basic 吗?请帮我翻译这段代码。 'County
我在逆向此代码以从 qwerty 解密回 abc 时遇到问题。 我不知道从哪里开始。我尝试用包含 ABC 的字符串替换索引...我还尝试将密文交换为 abc 并将索引更改为 qwerty,但无济于事。
我正在尝试设置一个 cron 作业,我收到了以下命令:wget -0 - -t 1 但我无法完全弄清楚如何使用此资源: http://www.computerhope.com/unix/wget.ht
这个问题在这里已经有了答案: tkinter creating buttons in for loop passing command arguments (4 个答案) 关闭 8 个月前。 我一直
我是 CMake 的新手(通常对 Makefiles、C 和 C++ 还是相当陌生)。我的任务是将我们当前的构建系统更改为使用 CMake 生成 Makefile 并编译我们的代码的系统。我在破译 C
我正在“玩”C++ 中的虚拟继承,我想知道一个类对象是如何布局的。我有这三个类: class A { private: int a; public: A() {this->a = 47
我正在尝试解读与 clr20r3 关联的 P1...P10 参数的含义,当我的应用程序遇到异常时,这些参数会写入事件日志。 我所拥有的最好的been able to find是: P1:托管进程(例如
我有一个带有 postgresql 后端的 Django 网络应用程序,用户可以在其中聚集并互相发送消息。这些消息可以被赞成或反对。如果有任何滥用行为,有很多反对票的人会得到“ghost banned
源代码 class W { public: virtual void f() { cout f(); // Invokes B::f why not w::f paw 指向 AW 的 vtable
我记得曾经看到一个网站,它破译了复杂的 C++ typedef,包括返回函数指针的函数指针,这些函数返回一个数组...... 它将把这样的定义变成可读的英文文本:»指向函数的指针,返回一个 int 指
我有这个 DIV 标签,其中有一个类定义。 我搜索了整个元素,但使用文本搜索功能在任何地方都找不到这个类。 目前,DIV 太宽了,我需要将其缩小一点。 每当我删除 class="clear
所以......我可以理解matlab函数句柄及其目的。但有时,当它变得过于神秘时,我需要帮助来进一步阐述它。 从默认 MATLAB documentation 中获取此示例,说: f = @(x)x
我正在尝试从 VB6 应用程序调用 TAPI32.dll 上的函数。我不知道如何在 VB6 中指定信息并调用它。所以,这个问题问的是帮助破译MSDN中的C++相关信息,并在VB6中调用它,但我在下面详
我是一名优秀的程序员,十分优秀!