Saturday, November 3, 2018

javascript: how i can define is object jQuery object or something else object?





So, i have two objects:



var object1 = $('div');
var object2 = {};


How i can define is this jQuery object, or not?




for javascript version < 1.4


Answer



var abc={};

if(typeof(abc.jquery)=="undefined"){

console.log("object is not a jquery object");

}else{


console.log("object is a jQuery object");

}


if object is jQuery object then



objectIdentifier.jquery =< version of jQuery>


No comments:

Post a Comment

plot explanation - Why did Peaches&#39; mom hang on the tree? - Movies &amp; TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...