문제

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.

The error I see when I have 5+ instances of the portlet on the page is:

SCRIPT87: Invalid argument. jquery-1.5.2.min.js, line 16 character 25442

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:

  1. Upgraded the jQuery and jQuery-UI libraries. The code uses 1.5.2 and 1.7.2 respectively. Upgrading to the latest versions made no difference.
  2. Upgraded the jqGrid library. The code uses version 4.1.2. Upgrading to 4.3.2 made no difference.
  3. Upgraded the bgiframe plug-in. The code uses version 2.1. Upgrading to 2.1.3 made no difference.

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?

UPDATE:

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

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 );
            }

Any ideas?

도움이 되었습니까?

해결책

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.

다른 팁

Maybe your page is adding a JSON that is not well formed.

var jsonThatWorksOnFirefoxAndChrome = {
    first:"ok",
    last: "not ok, remove the comma after this string to fix it",
}

Chrome and Firefox will just ignore the final comma.

Also check for jQuery conflicts and make sure you include only one version of jQuery and only once.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top