For example i need to check if current context is jQuery stack. How would you do it? Ignoring methods checking. It’s ugly solution. 🙂
For example:
if(it_is_jquery_stack_context) {
// do some stuff with jQuery support
}
else {
// do some stuff without it
}
UPDATE
For example:
if(typeof this.get=='function' && this.length && this.get(0)===dom_ element) {
// do some stuff
}
The last question is:
How to check if this.get(0) is instance of dom element?
Really just guessing your problem here but if you mean to check if
thisrefers to an jQuery object you can do:note that by jQuery object I mean a jQuery object, not the jQuery namespace.. as in
"jquery" in jQueryis false but"jquery" in jQuery("div")is true.For example:
But this is useless as jQuery objects don’t always have dom nodes in them.