Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8436685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:14:54+00:00 2026-06-10T07:14:54+00:00

jQuery passes a version of itself to global scope with this statement: window.jQuery =

  • 0

jQuery passes a version of itself to global scope with this statement:

window.jQuery = window.$ = jQuery;

as shown in this SO Post.

Looking at the jQuery source we can see the definition is in top scope for jQuery and defined like this:

// Define a local copy of jQuery
jQuery = function( selector, context ) {
    // The jQuery object is actually just the init constructor 'enhanced'
    return new jQuery.fn.init( selector, context, rootjQuery );
},

The selector seems pretty straight forward to use: Just pass in a string to select an element or elements from the DOM.

However, how do you use the context parameter correctly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T07:14:55+00:00Added an answer on June 10, 2026 at 7:14 am

    From the jQuery manual:

    jQuery()

    […]

    Selector Context

    By default, selectors perform their searches within
    the DOM starting at the document root. However, an alternate context
    can be given for the search by using the optional second parameter to
    the $() function. For example, to do a search within an event handler,
    the search can be restricted like so:

    $('div.foo').click(function() { $('span', this).addClass('bar'); });
    

    When the search for the span selector is restricted to the context of
    this, only spans within the clicked element will get the additional
    class.

    Internally, selector context is implemented with the .find() method,
    so $('span', this) is equivalent to $(this).find('span').

    Note that jQuery looks at the presence and type of its parameters and acts accordingly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

jquery looks like this $.post('JSP/processForm.jsp', $(#Form).serialize(), function(data){ //I want to iterate through every line
JQuery code: //This passes NULL for CategoryID, CategoryName, ProductID, ProductName $(#btnPost).click(function () { var
a jQuery event passes me e. I can then use: e.currentTarget which gives me
I am using the FullCalendar plugin for JQuery. This plugin passes a unix timestamp
I have an application which parses strings and passes them via jQuery to a
In jQuery, a DOM node or jQuery object can be passed as an attribute
Jquery did not carry out!!!I don't know why $(.other-edithion).click(function(){ var city = $(this).closest('#city'); if
Short version: I'm extending a jQuery object function that is intended to take 0-3
I have a jquery block that does some ajax stuff like this: $.ajax({ url:
Did jquery ajax $.post() method work in Safari 3.2.3 (525.29) or other? I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.