Refactor jQuery.data a bit to reduce property lookups

- Also added jQuery.isEmptyObject
This commit is contained in:
Yehuda Katz 2009-07-16 07:32:31 +00:00
parent d36d224cc5
commit 190812c3be
2 changed files with 21 additions and 23 deletions

View file

@ -291,6 +291,12 @@ jQuery.extend({
return this.constructor.call(obj) === Object;
},
isEmptyObject: function( obj ) {
var name = "";
for(name in obj) break;
return !name;
},
// check if an element is in a (or is an) XML document
isXMLDoc: function( elem ) {
return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||