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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:39:47+00:00 2026-05-20T19:39:47+00:00

Say you create a widget called my_widget and instantiate it on my_div as such:

  • 0

Say you create a widget called my_widget and instantiate it on my_div as such:

jQuery('#my_div').my_widget()

Suppose my_widget has a do_something method. According to the widget factory documentation you would access do_something like:

jQuery('#my_div').my_widget('do_something', ['arg1','arg2'])

That’s proving to be pretty cumbersome. It’s error prone since if for some reason my_div doesn’t yet have a widget, jQuery UI simply creates a new instance if you try to run do_something. Is there a better way?

Ideally there should be a way to say:

widget = jQuery('#my_div').my_widget('get_instance')
...
widget.do_something('arg1', 'arg2')

Is there anything like get_instance built-in?

  • 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-20T19:39:48+00:00Added an answer on May 20, 2026 at 7:39 pm

    If you read jQuery Plugin Authoring you’ll see that this is the standard way to invoke a function within a plugin, and typical implementations provide no way to expose those functions as normal methods.

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

Sidebar

Related Questions

Lets say you want to create a listing of widgets The Widget Manufacturers all
Say you create a form using ASP.NET MVC that has a dynamic number of
Say I create an object thus: var myObject = {ircEvent: PRIVMSG, method: newURI, regex:
lets say i have a custom widget which has a ClickHandler. Here's the example:
Say I create one object and add it to my ArrayList . If I
Let's say you create a wizard in an HTML form. One button goes back,
Let's say I create an instance of a class and want to assign some
Let's say I create a jagged 2d array like so: public static char[,] phoneLetterMapping
Let's say that I create a Sub (not a function) whose mission in life
There are other posts that say you can create a control in windows forms

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.