Centralize the logic for throwing exceptions. Fixes #5913.
[jquery.git] / src / attributes.js
index 004c6b3..82a4de1 100644 (file)
@@ -281,7 +281,7 @@ jQuery.extend({
                                if ( set ) {
                                        // We can't allow the type property to be changed (since it causes problems in IE)
                                        if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
-                                               throw "type property can't be changed";
+                                               jQuery.error( "type property can't be changed" );
                                        }
 
                                        elem[ name ] = value;