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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:58:56+00:00 2026-05-16T02:58:56+00:00

I decide to write a plugin, but there is a moment I don’t know,and

  • 0

I decide to write a plugin, but there is a moment I don’t know,and i can’t find documentation about it so I decide to ask here.

For example when we wrote

$("#some_element").nameOfPlugin();

There are a lot of functions in nameOfPlugin, but how some_element connects with the plugin?

An example, or a link to some documentation will be very helpful.

Thanks.

  • 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-05-16T02:58:57+00:00Added an answer on May 16, 2026 at 2:58 am

    nameOfPlugin is the prototypal method which when inserted with the script element, extends jQuery so any jQuery objects can contain the method.

    All the internal code of nameOfPlugin happens inside of that prototypal method and the scope which is defined.

    Simple example of how you are extending jQuery, using Human instead of jQuery.

    function Human(){};
    Human.prototype.attack = function() { alert('attack') };
    var john = new Human;
    john.attack();
    

    As far as $() connecting to it, $() returns an array of DOM elements ( one or many ). The plugin gets invoked in the context of each of these, since the object owns the method because it is an instance of the jQuery constructor which owns the plugin methods you’ve been adding.

    $('body').hide() translates to calling the jQuery.prototype.hide method using document.body the DOM reference as the context.

    I suggest reading up on prototypal inheritance to understand this. A good resource would be Eloquent JS, particularly chapter 8.

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

Sidebar

Related Questions

I know there have been similar questions posted but I think the issue I'm
I didn't want to write this Q on here but I decided that enough's
I would like to ask for 3 information here: There is no integrated solution
Does anyone know about a good HTML editor which can be configured in such
I decide to write some applications using facebook and django (or even twisted, but
I'm aiming to write an application for galaxy tab and decide to use platform
I couldnt figure the problem out so after debugging i finally decide to write
I'm working on a Java plugin which would allow people to write to and
If I write the function: public static uint FindAUint(double firstParam) { } I can
Well, I understand this is quite vague to ask how many db write connections

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.