title: jQuery simulate click on tab with code execution
body: <p>The code below, when I click on a tab, I do a post and display the result in the tab. In some case, I'd like force the selected tab, but not only select the tab but select the tab + execute the code executed when I click on it.</p>
  
  <p>In my exemple, I like select the second tab (jLikeToSet = 1) and execute the code :</p>
  
  <pre><code>$.post('/Home/e2', function (data) {
          $('#tabs-2').html(data);
  });
  </code></pre>
  
  <p>jQuery :</p>
  
  <pre><code>    var $tabs = $("#tabs").tabs();
      var jLikeToSet = 1
      $("#tabs").bind('tabsselect', function (event, ui) {
          switch (ui.index) {
              case 0:
                  $.post('/Home/e1', function (data) {
                      $('#tabs-1').html(data);
                  });
                  break;
              case 1:
                  $.post('/Home/e2', function (data) {
                      $('#tabs-2').html(data);
                  });
                  break;
              case 2:
                  $.post('/Home/e3', function (data) {
                      $('#tabs-3').html(data);
                  });
                  break;
          }
      });
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div id="tabs"&gt;
      &lt;ul&gt;
          &lt;li&gt;&lt;a href="#tabs-1"&gt;Screen 1&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#tabs-2"&gt;Screen 2&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#tabs-3"&gt;Screen 3&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;div id="tabs-1"&gt;&lt;/div&gt;
      &lt;div id="tabs-2"&gt;&lt;/div&gt;
      &lt;div id="tabs-3"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How can I do this ?</p>
  
  <p>Thanks,</p>
  
  <p>Update1 :
  I tried to use this code :
  <code>$('#tabs').tabsClick(1);</code> but no work, sample come from here  <a href="http://www.eduteka.org/ajax/tabs3/" rel="nofollow">http://www.eduteka.org/ajax/tabs3/</a></p>