本文介绍了IE8中的Jquery问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Jquery在Safari和Firefox中运行良好。在IE8中(使用开发人员工具),我收到错误:无法获取位置属性。无效参数jquery-1.3.2.js,第12行字符12949。使用调试,脚本突出显示字符{J [G] = K}。



我不知道这是什么,但它似乎导致了问题!结果是在我的某个库中单击缩略图图像时,图像无法在IE8中打开。如果有人理解这个或如何纠正它,我将非常感激!在我的网站www.blueshiftgallery.com上查看运行中的问题(或不运行)非常感谢!

解决方案

我遇到了类似问题问题,我的代码在IE以外的所有浏览器中工作(通常的故事)。



当我使用jquery弹出一个对话框时,我收到了同样的错误信息。



最终我发现这是因为我使用的是pos参数,其值包含NaN而不是整数。



window.innerWidth 这一事实。解决方案是使用 $(window).width()



从技术上讲,我不认为这些是等效的,因为一个获得内部宽度而另一个获得总宽度但是为了我的目的它已经足够了。


Jquery runs fine in Safari and Firefox. In IE8 (using the Developer Tools), I get the error: "Could not get the position property. Invalid argument jquery-1.3.2.js, line 12 character 12949". Using debugging, the script highlights the characters {J[G]=K}.

I have no idea what this does, but it seems to cause the problem! The result is when a thumbnail image is clicked in one of my galleries, the image does not open in IE8. If anyone understands this or how to correct it, I'd be very grateful! See the problem in action (or not) on my website www.blueshiftgallery.com Many thanks!

解决方案

I was experiencing a similar problem, my code worked in all browsers except IE (the usual story).

I was getting the same error message when I was using jquery to pop-up a dialog box.

Eventually I figured out it was because I was using the pos parameter with values containing NaN rather than integers.

This was due to the fact I was using window.innerWidth when populating my pos array. The solution was to use $(window).width() instead.

Technically I don't think these are equivalent as one gets the inner width while the other gets the total width but for my purposes it was good enough.

这篇关于IE8中的Jquery问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-27 20:15