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

  • Home
  • SEARCH
  • 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 998413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:11:27+00:00 2026-05-16T07:11:27+00:00

How does jQuery-UI know to bind callbacks passed as init options? I’m thinking the

  • 0

How does jQuery-UI know to bind callbacks passed as init options? I’m thinking the answer is somewhere in the $.widget.bridge method (ln 71) but I’m not entirely sure what’s going on there.

An example of what I’m talking about is something like the autocomplete search event. The code example shows that I can bind to ‘search’ with init options but I don’t see anything specific to this behavior autocomplete’s code.

This technique seems cool. I’d like to leverage it.

  • 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-16T07:11:28+00:00Added an answer on May 16, 2026 at 7:11 am

    I’m not that familiar with the jQueryUI code, but here’s an example of how you could call a callback passed as an argument.

    Try it out: http://jsfiddle.net/pshLK/

    When the example loads, you’ll get 2 alerts. This is the result of the callback that was passed running for both of the matched <div> elements. You can change the callback function and click “Run” at the top to see that your callback is running.

    (function($) {
           // create myPlugin
        $.fn.myPlugin = function(options) {
               // iterate through all elements the selector matched
            return this.each(function() {
                    // Change the color to blue
                $(this).css('color','blue');
                    // Call the callback using the .call() method
                    //    so that we can pass the value of "this"
                    //    as the element in the iteration
                options.callback.call(this);
            });
        };
    })(jQuery);
    
       // Find all <div> elements on the page, and call myPlugin which
       //   receives an object as an argument that has a "callback" property
       //   whose value is the function that will be called in the plugin.
    $('div').myPlugin({
             // This function will run for each <div> displaying the ID of the <div>
        callback:function() { alert('the id is ' + this.id); }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What function does jquery ui use to override the default options passed to a
I know jQuery does most when it comes to cross-browser issues. I just wanted
what does this code performs? if(object.jquery){ .... } I don't know what jQuery attribute
Does anyone know of a jQuery plugin that has 'helpers' or extensions like those
Does anyone know the d3 equivalent to jQuery attribute selector: $('[attribute=name]') I want to
Does anyone know if theres a jquery autocomplete library that works similar to the
Does anybody know how/when/why/who/where of if the JQuery intellisense files live for JQuery 1.4.2.
Does anyone know where I may find a really simple easy jQuery and PHP
Does anyone know what's going to be in the next version of jquery (1.3.3
Does anyone know why .hide(normal) does not seem to be working in jQuery 1.4.2?

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.