问题描述
我有一个在Firefox和Chrome中完美运行的portlet应用程序,但是在IE 8和9中爆炸,但是只有在门户页面上有5个或更多portlet实例时才会出现。如果页面上有4个或更少的portlet实例,它在IE中也能正常工作。
I have a portlet application that works flawlessly in Firefox and Chrome, but is bombing out in IE 8 and 9, BUT only if I have 5 or more instances of the portlet on the portal page. If there are 4 or less instances of the portlet on the page, it works fine in IE too.
当我有5个以上的portlet实例时看到的错误页面是:
The error I see when I have 5+ instances of the portlet on the page is:
该代码使用jQuery和少量插件-ins,即jqGrid。以下是我迄今为止尝试解决此问题的方法,其中没有一个有任何区别:
The code uses jQuery and a handful of plug-ins, namely jqGrid. Here is what I have tried so far to resolve the issue, none of which has made any difference:
- 升级了jQuery和jQuery-UI库。代码分别使用1.5.2和1.7.2。升级到最新版本没有任何区别。
- 升级了jqGrid库。该代码使用版本4.1.2。升级到4.3.2没有区别。
- 升级了bgiframe插件。该代码使用2.1版。升级到2.1.3没有区别。
因为它是IE,所以很难调试以查看发生了什么。
Because it is IE, it is very difficult to debug to see what is going on.
有没有人在此之前看到这种行为或对可能发生的事情有所了解?
Has anyone seen this behavior before or have any idea as to what may be going on?
更新:
好的,我已经用非缩小版本替换了jQuery文件的最小版本。这是我在IE 8页面上有5个以上portlet实例时看到的错误:
OK, I have replaced the min versions of the jQuery files with the non-minified ones. Here is the error I see when I have 5+ instances of the portlet on the page in IE 8:
Message: Invalid argument.
Line: 2105
Char: 5
Code: 0
URI: https://nasa-iceint.nasa.gov/portal/ice-theme/js/jquery-1.5.2.js
以下是jQuery文件中的相关代码:
Here is the pertinent code from the jQuery file:
if ( set ) {
// convert the value to a string (all browsers do this but IE) see #1070
elem.setAttribute( name, "" + value );
}
任何想法?
推荐答案
我弄清楚这里出了什么问题。事实证明,当已经加载了大量CSS时,在IE中动态加载CSS文件会导致问题。请参阅
I figured out what was going wrong here. It turns out that loading a CSS file dynamically in IE when there is already a lot of CSS loaded can cause issues. See Dynamically loading css stylesheet doesn't work on IE
希望这可以帮助遇到同样问题的其他人。
Hopefully this helps someone else down the road who encounters the same issue.
这篇关于IE使用jquery的参数无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!