Computing desk | ||
---|---|---|
< February 22 | << Jan | February | Mar >> | February 24 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
browser.window.document.element.console
Above is the traditional Js object chain. Where should the Jquery object be inserted inside this chain? (I would bet, right after document). Ben-Yeudith (talk) 15:17, 23 February 2017 (UTC)
window
(i.e. it has 'global scope', so you can call it from anywhere in your code without having to qualify it). As well as being a function it also has members, most of which are themselves functions: for example $.ajax()
and its related functions such as $.get()
and $.get()
. There's perhaps some confusion about the things that are returned by the jQuery function, as in var myItem = $('#myId');
, which are sometimes called 'jQuery objects' or 'jQuery object instances', and are things that you can perform actions on, such as $("#myId").fadeOut("slow");
. (The global jQuery object doesn't have most of these 'action' functions: $.fadeOut
is undefined.) AndrewWTaylor (talk) 16:18, 23 February 2017 (UTC)
but it's also an object (as all functions are in JavaScript)I didn't consider that, but you're right, of course. So yes, it would sit parallel with the document. ᛗᛁᛟᛚᚾᛁᚱPants Tell me all about it. 16:56, 23 February 2017 (UTC)