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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:31:47+00:00 2026-05-27T23:31:47+00:00

I am programming a new jquery-ui widget from scratch. I found the official ‘how

  • 0

I am programming a new jquery-ui widget from scratch.
I found the official ‘how widget factory works’ document.
(http://jqueryui.com/demos/widget/)

The widget itself works fine.
Now I want to store some values internally – is there a preferred way to do this?
All properties that are declared in options are public I think.

Thanks for your help!

  • 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-27T23:31:47+00:00Added an answer on May 27, 2026 at 11:31 pm

    Just use plain old properties on this. For example, a basic widget will look something like this:

    $.widget('some_name', {
        options: { /* ... */ },
        _create: function() {
            // ...
            this.internal_value = 11;
            // ...
        },
        frobnicate_by: function(this_much) {
            this.internal_value += this_much;
        }
        // ...
    });
    

    And you can set up your internal values as properties of this as desired. For example, the above sets this.internal_value to an initial value of 11 and $(s).some_name('frobnicate_by', 23) would change the internal_value.

    You can see an example of an internal property in the example widget you linked to by looking for this.changer.

    The options are used for things that can be configured when someone creates an instance of your widget. Internal settings don’t need any special handling, they’re just plain old object properties; one of the nice things about the widget factory is that it makes it easy to do normal OO things in your widgets.

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

Sidebar

Related Questions

I'm very new to jquery and programming in general but I'm still trying to
I am very new to jQuery and javascript programming. I have a program below
I'm very new to web programming and jQuery. I want to load images and
A programmer installed jquery lightbox and everything was working fine on http://www.ozhiphopshop.com.au/sub_photos.php?id=11 I wanted
I am a bit new to programming in jQuery/Javascript and am having some issues
I am new to programming especially jQuery and webservices. I want to pass the
I am new to programming especially jQuery. I am trying to use ColorBox to
I am new to programming especially jQuery. I am trying to sort (order) images
I'm pretty new to jQuery and javaScript programming and wondered if anyone could help
Hi Im new to programming jQuery and i have a quick code snippet that

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.