查看我在IE的任何版本中工作的站点时,我会看到完成的错误消息,似乎加载的唯一东西是背景。真的不知道如何去解决这个问题,我甚至不知道错误的含义。Internet Explorer中的无效参数
的错误是在线117
无效参数它工作正常,在Firefox,Safari和Chrome浏览。
这里是网址:http://streamlinehome.com/wordpress/
查看我在IE的任何版本中工作的站点时,我会看到完成的错误消息,似乎加载的唯一东西是背景。真的不知道如何去解决这个问题,我甚至不知道错误的含义。Internet Explorer中的无效参数
的错误是在线117
无效参数它工作正常,在Firefox,Safari和Chrome浏览。
这里是网址:http://streamlinehome.com/wordpress/
尝试把一个'周围的文件名。
#header {
background-image: url(images/header-plain.png);
}
w3School的例子显示了一个引用文件名: http://www.w3schools.com/css/pr_background-image.asp
117点,jQuery的文件。 调试代码错误发生在if(e)f [b] = d;
在您所呼叫的jQuery的方法在这里
线63 supersubs.js调用堆栈退一步:
$ul.css('width',emWidth);
查找几行你会看到关于clientWidth的注释,那可能是麻烦的地方es开始。 :)
var emWidth = $ul.add($LIs).add($As).css({
'float' : 'none',
'width' : 'auto'
})
// this ul will now be shrink-wrapped to longest li due to position:absolute
// so save its width as ems. Clientwidth is 2 times faster than .width() - thanks Dan Switzer
.end().end()[0].clientWidth/fontsize;
// add more width to ensure lines don't turn over at certain sizes in various browsers
所以看它多一些行...结束()[0] .clientWidth返回0和字体大小= 0,因此有0/0这是NaN
所以这个bug是在你的supersubs.js插件中。 :)你不喜欢第三方代码。 – epascarello 2010-08-09 20:50:59
+1它总是很高兴看到一个清晰的,一步一步,调试真棒 – icc97 2013-06-07 13:09:50
我可以” t为你的问题提供了一个完整的答案,但我可以告诉你为什么你会得到一个'无效论证'的错误。
简而言之,IE尝试将元素的宽度设置为"NaNem"
。试图这样做会导致IE生成一个“无效参数”错误。
但为什么IE试图将这个元素的宽度设置为这个无意义的值?这个宽度首先出现在supersubs插件的一个函数中。下面的代码试图找到在当前字体的破折号的宽度($$
包含<ul>
元素):
var fontsize = $('<li id="menu-fontsize">—</li>').css({
'padding' : 0,
'position' : 'absolute',
'top' : '-999em',
'width' : 'auto'
}).appendTo($$).width(); //clientWidth is faster, but was incorrect here
然而,IE计算fontsize
为0
稍后,的值这个变量用于:
var emWidth = $ul.add($LIs).add($As).css({
'float' : 'none',
'width' : 'auto'
})
// this ul will now be shrink-wrapped to longest li due to position:absolute
// so save its width as ems. Clientwidth is 2 times faster than .width() - thanks Dan Switzer
.end().end()[0].clientWidth/fontsize;
看来clientWidth
这里也为0,因此这给emWidth
价值NaN
。
最后,下面添加一个“时间”单元emWidth
(因此NaNem
),并尝试以设置<ul>
到"NaNem"
的宽度。IE浏览器是不是有这一点,给你“无效参数”错误:
emWidth += 'em';
// set ul to width in ems
$ul.css('width',emWidth);
但是,我怕我不能说,为什么IE为fontsize
返回0。我猜测supersubs插件中可能存在的一个bug - 也许值得在jQuery论坛上提出这个问题,或者,作为supersubs插件本身建议的jQuery Google Group?
这似乎是在64位操作系统上运行的Internet Explorer 32位问题。试图运行IE 64位它不会发生。
与CSS无关 – epascarello 2010-08-09 20:45:22