title: JQuery - Widget Public Methods
body: <p>If I create a JQuery widget (code example below), and then define a "public" method, is there any other way to call the method other than using the following form?  </p>
  
  <pre><code>$("#list").list("publicMethod"); 
  </code></pre>
  
  <p>I would like to create a series of widgets that all define the same methods (basically implementing the same interface), and be able to call the method without knowing anything about which widget I currently am invoking the method on. In the current form, I need to know that I am executing the method on the "list" widget.</p>
  
  <hr>
  
  <p>Below is an example of creating a widget with the "public" method.</p>
  
  <pre><code> (function($) {
      var items = [];
      var itemFocusIdx = 0;
  
      $.widget("ui.list", {
          // Standard stuff
          options : { ... },
          _create : function() { ... },
          destroy : function() { ... },
  
          // My Public Methods
          publicMethod : function() { ... }
          ...
      });
  }(jQuery));
  </code></pre>