]> source.dussan.org Git - jquery.git/commitdiff
Move the check for the name attribute out of attr and down to the formHook definition
authortimmywil <tim.willison@thisismedium.com>
Wed, 30 Mar 2011 21:13:15 +0000 (17:13 -0400)
committertimmywil <tim.willison@thisismedium.com>
Sun, 3 Apr 2011 23:13:41 +0000 (19:13 -0400)
src/attributes.js

index e80fede9328e56cc75667ba5115bec16a96ab628..f0398559047428b736f91a343c219c3d0cd9e652 100644 (file)
@@ -301,7 +301,7 @@ jQuery.extend({
 
                // Get the appropriate hook, or the formHook
                // if getSetAttribute is not supported and we have form objects in IE6/7
-               hooks = jQuery.attrHooks[ name ] || ( ( name === "name" || elem.nodeName === "FORM" ) && formHook );
+               hooks = jQuery.attrHooks[ name ] || ( elem.nodeName === "FORM" && formHook );
 
                if ( value !== undefined ) {
 
@@ -426,7 +426,7 @@ if ( !jQuery.support.getSetAttribute ) {
        
        // Use this for any attribute on a form in IE6/7
        // And the name attribute
-       formHook = {
+       formHook = jQuery.attrHooks.name = {
                get: function( elem, name ) {
                        var ret = elem.getAttributeNode( name );
                        // Return undefined if not specified instead of empty string