سؤال

I am doing some browser testing for a web page and have come across an issue with IE9 in compatibility mode. By merely including jqueryui, an error occurs in the main jquery code. This causes IE9 to "whitescreen" when in compatibility mode.

Looking at the error console, I see this:

SCRIPT87: Invalid argument. 
jquery.js, line 1061 character 4

This leads to the "attr" method in jquery:

l060: if ( set )
1061:      elem[ name ] = value;

I've reduced my code to the bare minimum necessary to reproduce this issue. As you can see, I've yet to even define or execute any javascript of my own. Is it as simple as "jqueryui breaks in IE, deal with it"?

What is the best way to proceed. I expect the code I am writing to be accessed by a large number of users with a wide range of browsers.

<html>
    <head>
        <title>I am a web page</title>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
    </head>
    <body>
        I am content
    </body>
</html>
هل كانت مفيدة؟

المحلول

jQuery UI 1.8.18 is intended to be used with jQuery 1.7+. I was able to recreate your issue and when I switched to the newest version of jQuery the issue went away.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script>

Live example - http://jsfiddle.net/Cd9JC/1/

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top