HMR
HMR

Reputation: 39320

$.toString() at google keywords says [native code]

I always thought that if you use toString() on a function and it shows [native code] that that was because it is native code. Like the output of XMLHttpRequest.toString() in firebug gives me:

function XMLHttpRequest()
{
    [native code]
}

When opening the google keywords page and opening firebug console the following command: $.toString() gives me:

 function ()
   {
        [native code]
    }

I do wonder how they did that, maybe their $ object implements a toString() method returning that string?

Upvotes: 0

Views: 298

Answers (1)

jfriend00
jfriend00

Reputation: 707916

In the Firebug console, $ is a pseudo-shortcut for document.getElementById() and that shortcut is implemented in Firebug's code.

Try typing $("#doc") in Firebug in that google keywords page. You don't get a jQuery object, you get a DOM object from that page.

Upvotes: 2

Related Questions