Hi, I first posted this message on the jquery-en group, but it should probably be posted here, so here am I.
In some cases, I have to check if a variable is a jQuery object or not. Usually, to check a variable type, I use the "constructor" property (when I can't use typeof, which is not accurate). In case of jQuery, the constructor property equals Object, so I can't use it. When I create a jQuery Object, it's known by javascript as an object, and it behaves like a function. Would it be possible to add something so we could get a true with this example : $([]).constructor === jQuery This would be great, no ?? The only change to do is to add in the beginning of jQuery.fn.init method the line : this.constructor = jQuery; This way, all jQuery's objects "constructor" property equals jQuery. I quickly tried this, and I met no bugs. Any arguments against this ? Nico --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---