]> source.dussan.org Git - jquery.git/commitdiff
Get actual values for attributes in IE and fix #910 so that it does not crash safari
authorBrandon Aaron <brandon.aaron@gmail.com>
Fri, 9 Feb 2007 19:52:31 +0000 (19:52 +0000)
committerBrandon Aaron <brandon.aaron@gmail.com>
Fri, 9 Feb 2007 19:52:31 +0000 (19:52 +0000)
src/jquery/jquery.js

index befaef64d03b903dcf1e8513525ca0fb365fcc8f..3693ee373a0623ac8fb379552a472725ee38fbdb 100644 (file)
@@ -1470,7 +1470,7 @@ jQuery.extend({
                        if ( arg.length === 0 )
                                return;
                        
-                       if ( arg[0] == undefined || jQuery.nodeName(arg[0],"form") )
+                       if ( arg[0] == undefined || (jQuery.browser.msie && jQuery.nodeName(arg,"form")) )
                                r.push( arg );
                        else
                                r = jQuery.merge( r, arg );
@@ -1495,6 +1495,8 @@ jQuery.extend({
                        selected: "selected"
                };
                
+               var fixIE = jQuery.isXMLDoc(elem) ? [] : "href,src,background,cite,classid,codebase,data,longdesc,profile,usemap".split(',');
+               
                // IE actually uses filters for opacity ... elem is actually elem.style
                if ( name == "opacity" && jQuery.browser.msie && value != undefined ) {
                        // IE has trouble with opacity if it does not have layout
@@ -1525,7 +1527,7 @@ jQuery.extend({
                // IE elem.getAttribute passes even for style
                else if ( elem.tagName ) {
                        if ( value != undefined ) elem.setAttribute( name, value );
-                       if ( name == "href" && jQuery.browser.msie && !jQuery.isXMLDoc(elem) ) return elem.getAttribute( name, 2 );
+                       if ( jQuery.browser.msie && fixIE[name] ) return elem.getAttribute( name, 2 );
                        return elem.getAttribute( name );
 
                // elem is actually elem.style ... set the style