Accessing XML attribute named “type” using jQuery.attr() broken on IE 7

I ran into an issue with jQuery 1.10.1 on IE 7. Accessing the XML attribute named “type” with $.attr( “type” ) throws an error in the new function interpolationHandler(); Here’s a little test HTML document:

<!DOCTYPE html><html><head></head><body>
 
<!--jQuery 1.10.1 in IE 7 throws SCRIPT450 (wrong number of arguments) error in function interpolationHandler(){}-->
<script src="http://code.jquery.com/jquery-1.10.1.js"></script>
 
<script type="text/javascript">
 
    var xmlString = '<list><item type="type-a" other="other-a"/><item type="type-b" other="other-b"/></list>';
    var xml = $.parseXML( xmlString );
 
    $( xml).find( "item" ).each( function() {
 
        // Always works
        var otherValue = $(this).attr( "other" );
        alert( otherValue );
 
        // jQuery 1.10.1 in IE 7 throws SCRIPT450 (wrong number of arguments) error in function interpolationHandler(){}
        var typeValue = $(this).attr( "type" );
        alert( typeValue );
 
    });
 
</script></body></html>

Bug report on jQuery bug tracker: http://bugs.jquery.com/ticket/13974

USING JQUERY 1.9.1 WORKS JUST FINE!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.