[jquery-dev] Re: jQuery("").get(0) is not a DOM Element in FF, but is in Safari. Is this a bug?

Mon, 18 May 2009 03:21:05 -0700

On May 18, 12:14 am, John Resig wrote:
> To be clear - Firefox is returning an <object/> element - the bug
> is that doing typeof on an <object/> element returns function in
> jQuery (but it is, in fact, not a function).

What makes it "not a function", it can be called? Granted, calling it
(them) tends to throw exceptions, but those exceptions are not the "x
is not a function" exceptions that are thrown when you try calling
things that are not functions.

Generally, it seems very reasonable to take the position that if
something can be called it is then a function.

> It's just a silly bug in Firefox,

That may just be an expectation mismatch. There is nothing in the W3C
DOM specs or their ECMAScript binding that requires that all (or any)
objects implementing the DOM Element interface not be functions. The
specs require them to be objects, but functions are objects in
javascript. Move the expectations inline with the specifications and
the observed behaviour becomes faultless.

> everything still
> works as you would expect it to.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to