title: How do I use .on() for subpage content within a jQuery tab?
body: <p>After some research I now have links in my jQuery tabs loading additional pages within the current tab. What I am trying to understand now is how to get the additional sub page links to also stay within the tab. </p>
  
  <p>So in this example everything works to a point. tabtest.htm loads the tabs and in Main One clicking Sub One A loads sub1a.htm in the tab. Clicking the link within sub1a.htm breaks me out of the jquery/tab universe. I would like to learn how to get links in that page to also use the "link within the current tab" code.</p>
  
  <p>tabtest.htm</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="/m/j/jquery-1.9.1.js"&gt;&lt;/script&gt;
  &lt;script src="/m/j/jquery-ui-1.10.3.custom.min.js"&gt;&lt;/script&gt;
  &lt;link href="/m/c/smoothness/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" type="text/css"&gt;&lt;/link&gt;
  
  &lt;script type="text/javascript"&gt;
   $(function() {
      $("#tabs").tabs({
        load: function(event, ui) {
        $("a", ui.panel).click(function() {
          $(ui.panel).load(this.href);
            return false;
          });
        }
      }),
      $('.ui-tabs-panel a').click(function() {
        $(this).closest('.ui-tabs-panel').load(this.href);
        return false;
      });
    });
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
     &lt;div id="tabs" &gt;
      &lt;ul&gt;
         &lt;li&gt;&lt;a href="mainone.htm"&gt;Main One&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href="maintwo.htm"&gt;Main Two&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="mainthree.htm"&gt;Main Three&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>mainone.htm</p>
  
  <pre><code>&lt;h1&gt;Main One&lt;/h1&gt;
  &lt;a href="sub1a.htm"&gt;Sub One A&lt;/a&gt;
  &lt;a href="sub1b.htm"&gt;Sub One B&lt;/a&gt;
  </code></pre>
  
  <p>sub1a.htm</p>
  
  <pre><code>&lt;h1&gt;Sub One A&lt;/h1&gt;
  &lt;a href="mainone.htm"&gt;Main One&lt;/a&gt;
  </code></pre>