jquery core: Simplifying isEmptyObject() and adding tests.
[jquery.git] / src / core.js
index b51886f..a71656d 100644 (file)
@@ -291,6 +291,12 @@ jQuery.extend({
                return this.constructor.call(obj) === Object;
        },
 
+       isEmptyObject: function( obj ) {
+               for(var name in obj)
+                       return false;
+               return true;
+       },
+
        // check if an element is in a (or is an) XML document
        isXMLDoc: function( elem ) {
                return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||