title: jQuery plugin with multiple methods
body: <p>I am going to wrap some of my functions in a nice manner and for this I want to go with jQuery approach. Like jQuery having a lots of methods</p>
  
  <pre><code>$.parseJson()
  $.ajax()
  $("div").text("hey my testing");
  </code></pre>
  
  <p>and both methods are present in a same jQuery file. But while reading about how to make a jquery plugin, its specified that you don't need to create multiple functions inside a same plugin. Instead pass an argument which contains the method name as string.</p>
  
  <p>So, Is that the below snippet is correct or do i need to make some corrections in it.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      (function ($) {
          $.fn.testMethod1 = function () {
              return $(this).each(function () { });
          };
          $.fn.testMethod2 = function () {
              return $(this).each(function () { });
          };
          $.test = function () {
              return "testresult"
          };
      })(jQuery);
  
      $("div1").testMethod1();
      $("div2").testMethod2();
      $.test();
  
      //Is that needed to be replace in a different way like
      $("div1").myPlugin("testMethod1");
      $("div1").myPlugin("testMethod2");
      $("div1").myPlugin("test");
  
  
  &lt;/script&gt;
  </code></pre>