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 8567219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:49:54+00:00 2026-06-11T17:49:54+00:00

One assigns a plugin to the jQuery prototype property. What’s the point of doing

  • 0

One assigns a plugin to the jQuery prototype property. What’s the point of doing this when one doesn’t use ‘new’ with jQuery? There’s only ever one instance of jQuery isn’t there? So couldn’t plugins be assigned directly to the singleton jQuery object?

  • 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-11T17:49:56+00:00Added an answer on June 11, 2026 at 5:49 pm

    Plugin methods must be automatically added to each new jQuery object that is created.

    jQuery.fn is the same as jQuery.prototype so assigning a plugin method to jQuery.fn is adding it to the jQuery prototype so whenever a new jQuery object is created, that method will automatically be available. Technically, it’s a jQuery.fn.init object, but the idea is the same.

    Calling jQuery with a string like this:

    $(".foo")
    

    creates a new jQuery.fn.init object which gets its prototype from jQuery.fn (where plug-in methods are defined).

    Here’s the relevant jQuery code that shows a new object getting created:

    // Define a local copy of jQuery
    var jQuery = function( selector, context ) {
        // The jQuery object is actually just the init constructor 'enhanced'
        return new jQuery.fn.init( selector, context, rootjQuery );
    },
    
    
    // Give the init function the jQuery prototype for later instantiation
    jQuery.fn.init.prototype = jQuery.fn;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the jQuery tablesorter plugin to sort a table, which assigns .click() handlers
I am using this plugin with one pane being shown at a time and
I have two apps that use Integrated Security. One assigns Integrated Security = true
I am currently developing a rather complex jQuery plugin. One that I am designing
In this C code i have tried to assign pointer addresses of one variable
In PowerDesigner v12, how would one, through use of VBScript, assign a TriggerTemplate to
jsFiddle I'm using a jQuery plugin that allows the user to draw boxes in
I am currently using markercluster plugin with jquery ui maps. I have two arrays
Not sure if I'm approaching this correctly ... Basically I have a plugin structure
Note I am using the local vim plugin that allows me to use a

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.