jQuery and split not working together?
<p>I'm playing around with jQuery tabs and have a prototype up and running.</p>

<p><a href="http://www.omnicom-innovations.com/play/tabsdemo.html" rel="nofollow">http://www.omnicom-innovations.com/play/tabsdemo.html</a></p>

<p>Here is my code:</p>

<pre><code>$(document).ready(function() {
    $("#tabs").tabs();

  // Select the second tab
  // $("#tabs").tabs({ selected: 1 });

  // http://viralpatel.net/blogs/2009/04/jquery-tabs-create-html-tabs-using-jquery-ui.html
  $('#tabs').bind('tabsselect', function(event, ui) {

    // Objects available in the function context:
    // alert(ui.tab);     // anchor element of the selected (clicked) tab
    var tabPageName = ui.tab;
    alert('Tab Name: ' + tabPageName);

    // var results = tabPageName.substring(tabPageName.IndexOf("#") + 1);
    // alert('Page Name: ' + results);

    var arrData = tabPageName.split("#");
    alert(arrData[1]);

    // alert(ui.panel);   // element, that contains the selected/clicked tab contents
    alert(ui.index);   // zero-based index of the selected (clicked) tab

  });
});
</code></pre>

<p>I am trying to extract the name of the tab:  (#fragment-1, etc...) in the anchor tag.  I am trying to use the split method (and IndexOf method as an alternative).</p>

<pre><code>&lt;div id="tabs"&gt;
    &lt;ul&gt;
    &lt;li&gt;&lt;a href="#fragment-1"&gt;&lt;span&gt;One&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#fragment-2"&gt;&lt;span&gt;Two&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#fragment-3"&gt;&lt;span&gt;Three&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;div id="fragment-1"&gt;
    &lt;p&gt;First tab is active by default:&lt;/p&gt;
    &lt;pre&gt;&lt;code&gt;$('#example').tabs();&lt;/code&gt;&lt;/pre&gt;
    &lt;/div&gt;
    &lt;div id="fragment-2"&gt;
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
    &lt;/div&gt;
    &lt;div id="fragment-3"&gt;
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>As you can see, I had to comment out the split() method because I'm receiving the following error:</p>

<p>Uncaught TypeError: Object <a href="http://www.omnicom-innovations.com/play/tabsdemo.html#fragment-3" rel="nofollow">http://www.omnicom-innovations.com/play/tabsdemo.html#fragment-3</a> has no method 'split'</p>

<p>but I know that the split method works in JavaScript.  Does anyone see what I could be missing?</p>
