{"id":805,"date":"2014-10-14T06:33:55","date_gmt":"2014-10-14T06:33:55","guid":{"rendered":"http:\/\/www.nikola-breznjak.com\/blog\/?p=805"},"modified":"2015-08-17T06:13:51","modified_gmt":"2015-08-17T06:13:51","slug":"what-is-the-difference-between-window-and-window-in-jqueryjavascript","status":"publish","type":"post","link":"https:\/\/nikola-breznjak.com\/blog\/stack-overflow\/what-is-the-difference-between-window-and-window-in-jqueryjavascript\/","title":{"rendered":"What is the difference between $(window) and window in jquery\/javascript"},"content":{"rendered":"<p><a href=\"http:\/\/stackoverflow.com\/users\/534755\/nikola\"><img loading=\"lazy\" decoding=\"async\" title=\"profile for Nikola at Stack Overflow, Q&amp;A for professional and enthusiast programmers\" src=\"http:\/\/stackoverflow.com\/users\/flair\/534755.png\" rel=\"lightbox[805]\" alt=\"profile for Nikola at Stack Overflow, Q&amp;A for professional and enthusiast programmers\" width=\"208\" height=\"58\" \/><\/a><br \/>\nI&#8217;m a big fan of <a href=\"http:\/\/stackoverflow.com\/\">Stack Overflow<\/a> and I tend to contribute regularly (am currently in the <a href=\"http:\/\/stackexchange.com\/leagues\/1\/alltime\/stackoverflow\/2008-07-31\/534755?sort=reputationchange#534755\">top 0.X%<\/a>).\u00a0In this category (<a href=\"http:\/\/www.nikola-breznjak.com\/blog\/category\/stack-overflow\/\">stackoverflow<\/a>)\u00a0of posts I will will be posting my top rated questions and answers. This, btw, is allowed as explained in the meta thread <a href=\"http:\/\/meta.stackoverflow.com\/questions\/266971\/can-i-post-so-questions-and-answers-in-a-personal-blog\/266973\">here<\/a>.<\/p>\n<p>My <a href=\"http:\/\/stackoverflow.com\/questions\/16939233\/what-is-the-difference-between-window-and-window-in-jquery-javascript\">quesiton<\/a> was:<\/p>\n<p>What is the difference between javascript window and jquery $(window)?<\/p>\n<p>I tried in the Chrome console and I get this:\u00a0<img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/HcKwZ.png\" alt=\"enter image description here\" \/><\/p>\n<p>So, I would conclude is &#8220;just&#8221; a window object wrapped in a jquery object in a way that then I can use jquery&#8217;s functions on it (like height(), width(), etc&#8230;)<\/p>\n<p style=\"color: #000000;\"><span style=\"line-height: 1.5;\">The answer, by user <a style=\"color: #4a6b82;\" href=\"http:\/\/stackoverflow.com\/users\/1230836\/elias-van-ootegem\">Elias Van Ootegem<\/a>\u00a0was:<\/span><\/p>\n<blockquote>\n<p style=\"color: #000000;\">When you write\u00a0<code>$(window)<\/code>, you should know that\u00a0<em>that<\/em>\u00a0piece of code is going to run on the JS engine. Ever why jQ objects all have parentheses around them? Simple because\u00a0<code>$<\/code>\u00a0is a function object. Basically you&#8217;re calling the\u00a0<code>$<\/code>\u00a0function, and passing the\u00a0<em>native<\/em>\u00a0global, or\u00a0<code>window<\/code>\u00a0object to it as an argument.<\/p>\n<p style=\"color: #000000;\">If you browse through the jQ source code, you&#8217;ll see that it&#8217;ll pass that object on to many internal functions and in the end, it&#8217;ll return a jQ wrapper object.<br \/>\nSo yes, your assumptions are pretty much correct.<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m a big fan of Stack Overflow and I tend to contribute regularly (am currently in the top 0.X%).\u00a0In this category (stackoverflow)\u00a0of posts I will will be posting&hellip;<\/p>\n","protected":false},"author":1,"featured_media":609,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[],"class_list":["post-805","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-stack-overflow"],"_links":{"self":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/805","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/comments?post=805"}],"version-history":[{"count":2,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/805\/revisions"}],"predecessor-version":[{"id":1707,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/805\/revisions\/1707"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media\/609"}],"wp:attachment":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media?parent=805"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/categories?post=805"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/tags?post=805"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}