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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:52:32+00:00 2026-05-14T06:52:32+00:00

In this link: http://css-tricks.com/snippets/jquery/jquery-plugin-template/ it has a line of code that says // Add

  • 0

In this link: http://css-tricks.com/snippets/jquery/jquery-plugin-template/ it has a line of code that says

// Add a reverse reference to the DOM object
base.$el.data("yourPluginName", base);

what does the “reverse reference to the DOM object” mean?

  • 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-14T06:52:33+00:00Added an answer on May 14, 2026 at 6:52 am

    Assuming that you know the jQuery data function:

    It’s storing a reference to the instance of the class in the data cache of jQuery, meaning that the stored instance can be used to access the initial base object if it in the current context is not available.

    This way, the class instance can be used later. However, the use of the prototype keyword upon the initial class that the instance were created from will modify the instance.


    EDIT:

    Ooops, it seems that Anurag is right, and I was giving wrong information.
    Sorry, the information I gave in initial answer was not completely correct. I’ve updated the answer, so it now tells the truth.
    In the comments you’re asking:

    so you mean its storing the current state of “base” in the data cache but if we make changes to “base” later on then the one in the data wont be affected? so if for some reason we needed to get the original one again we can do data(‘yourPluginName’) to retrieve it? can you give me an example of when this would be helpful?

    It seems that none of the statements are correct.

    As I did obviously not remember adequately, the thing stored in data is only a reference to the object:

    var obj = {};
    obj.hello = "Hello";
    $("#someElement").data("object", obj);
    obj.world = " world.";
    alert(
      obj.hello + 
      $("#someElement").data("object").world
    ); // alerts "Hello world."
    

    BTW, JavaScript variables with names like this base-thing (but, more often seen as that or similar) are typically used to represent the current context, accessed through the this keyword, which on many occasions is more easy to store in another variable due to scoping/context changes, that will make the current context and therefore this, change.

    Also due to issues with context, the stored value in data could be used to access the specific object instance from another context (that is, when this represents something else), instead of the version of the base object that was continually used after a copy of it was stored.

    I hope this answered you questions 😀

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

Sidebar

Related Questions

I've was studying on some source code from this link http://android-er.blogspot.com/2010/12/add-overlay-on-camera-preview.html what should i
I'm using this to link to some Google Fonts: <link href='http://fonts.googleapis.com/css?family=IM+Fell+English+SC|Snippet|Sarina|Crushed|Caesar+Dressing|Montez|Bad+Script|Sofia|Fontdiner+Swanky|Just+Me+Again+Down+Here|Voltaire|Geo|Coming+Soon|Wellfleet|Passion+One|Rock+Salt|Homemade+Apple|Meddon|Rosario' rel='stylesheet' type='text/css'> I'm
If you check out this link (http://noahsdad.com/state-fair-texas-2011/) you'll notice that scrolling side bar to
HI I installed http://css-tricks.com/examples/AnythingSlider/#panel-4 and it works perfect. But I cannot link a particular
Looking to tweak this script: http://css-tricks.com/examples/InfoGrid/ I've added an image within each dt, I'd
Here's a good article on creating links inside of larger clickable areas: http://css-tricks.com/links-inside-of-larger-clickable-areas/ This
This link http://ajaxcontroltoolkit.codeplex.com/releases/view/11121#DownloadId=28808 shows a popup on which one has to agree before being
I came across this link http://www.mathopenref.com/coordpolygonarea2.html It explains how to calculate the area of
Hi while trying out jni example in this link http://wendro.blogspot.com/2010/03/jni-example-eclipse-dev-cpp.html?showComment=1309930446765#c5048550711511727724 with eclipse Helios windows
am using the application in this link http://www.jeasyui.com/tutorial/app/crud2.php .I have added one more column

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.