Refactor jQuery.data a bit to reduce property lookups
- Also added jQuery.isEmptyObject
This commit is contained in:
parent
d36d224cc5
commit
190812c3be
2 changed files with 21 additions and 23 deletions
|
@ -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" ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue