-
From: "Klaus Hartl" <[EMAIL PROTECTED]>
To: "jQuery (English)"
Sent: Wednesday, October 31, 2007 3:06 AM
Subject: [jQuery] Re: Test if object is jQuery object
On 30 Okt., 17:55, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:
Is there a cool way
On 30 Okt., 17:55, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:
> Is there a cool way to check if an object is a jQuery object as opposed to
> any other object?
>
> I tried the constructor property but it just says Object(), the same as any
> other object.
>
> Tried typeof, but same deal, just obje
Another option would be obj instanceof $
On 10/30/07, Josh Nathanson <[EMAIL PROTECTED]> wrote:
>
>
> > if (obj.jquery) {
> > // it is a jquery object - jquery holds the version
> > }
> > else {
> > // not a jquery object
> > }
> >
>
> Thanks Eric and Wizzud, that's what I was looking for. Much
if (obj.jquery) {
// it is a jquery object - jquery holds the version
}
else {
// not a jquery object
}
Thanks Eric and Wizzud, that's what I was looking for. Much better than
what I was doing.
-- Josh
On Oct 30, 9:55 am, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:
> Is there a cool way to check if an object is a jQuery object as opposed to
> any other object?
>
> I tried the constructor property but it just says Object(), the same as any
> other object.
>
> Tried typeof, but same deal, just obj
Try ...
if(Object.jquery){
; // it's (probably) a jQuery object
}else{
; // it's not
}
On Oct 30, 4:55 pm, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:
> Is there a cool way to check if an object is a jQuery object as opposed to
> any other object?
>
> I tried the constructor property but it
6 matches
Mail list logo