title: uncaught exception: jQuery UI Tabs: Mismatching fragment identifier
body: <p>all. I have built a simple jQuery/PHP chat program that works rather well. However, I'd like to add a feature like channels or rooms. Ideally, I'd like to use tabs at the top of the chat to manage which room the user is in (there are only going to be 2). I thought this would be a simple task, and I have seen something similar done before, but I keep getting the uncaught exception error when the tabs are clicked, and the source doesn't load correctly. i'll post the code for the whole chat system, because I have a feeling the issue might lie therein.</p>
  
  <p>the jquery</p>
  
  <pre><code>page = {
      getChat: function() {
          $.ajax({
              url: 'game_src.php',
              data: 'mode=getChat',
              dataType: 'html',
              cache: false,
              success: function(res){
                  $("#chatbox").html(res);
              }
          });
      }
  };
  
  $("#submitmsg").click(function(){
      var clientmsg = $("#usermsg").val();
      $.ajax({
          url : 'game_src.php',
          data: 'mode=chatSubmit&amp;msg=' + encodeURIComponent(clientmsg)
      });
      $("#usermsg").attr("value", "");
      return false;
  });
  
  setInterval(page.getChat, 4000);
  
  $("#chatChannel").tabs({
      cookie: { expires: 1 },
  });
  </code></pre>
  
  <p>the chat body</p>
  
  <pre><code>&lt;?php
  if($user-&gt;data['user_id'] == ANONYMOUS)
  {
  
  }
  else
  {
      ?&gt;
      &lt;div id="chatChannel"&gt;
          &lt;ul&gt;
              &lt;li&gt;&lt;a href="#global"&gt;Global&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#alli"&gt;Alliance&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
      &lt;form name="message" action=""&gt;  
          &lt;input name="usermsg" type="text" id="usermsg" size="25" /&gt;  
          &lt;input name="submitmsg" type="submit" id="submitmsg" value="Send" /&gt;  
      &lt;/form&gt;
      &lt;br /&gt;
      &lt;?php
  }
  ?&gt;
  &lt;div id="chatbox" style="border:1px solid black;background-color: rgba(255,255,255,0.3);height:400px;overflow:auto;"&gt;
      &lt;div id="global"&gt;
      &lt;?php
      $chatMsgs = array();
      $limit = time()-86400;
  
      $sql = 'SELECT COUNT(chat_id) as count FROM '.CHAT_TABLE.' WHERE chat_channel = 0 AND chat_time &gt; '.$limit;
      $result = $db-&gt;sql_query($sql);
      $row = $db-&gt;sql_fetchrow($result);
      $count = $row['count'];
  
      if($count &gt; 0)
      {
          $sql = 'SELECT * FROM '.CHAT_TABLE.' WHERE chat_channel = 0 AND chat_time &gt; '.$limit.' ORDER BY chat_time DESC';
          $result = $db-&gt;sql_query($sql);
          while($row = $db-&gt;sql_fetchrow($result))
          {
              $chatMsgs[] = array(
                  'chat_time' =&gt; $row['chat_time'],
                  'chat_msg' =&gt; $row['chat_msg'],
                  'chat_user' =&gt; $row['chat_user'],
                  'chat_channel' =&gt; $row['chat_channel']
              );
          }
  
          foreach($chatMsgs as $msg)
          {
              $sql = 'SELECT username FROM '.USERS_TABLE.' WHERE user_id = '.$msg['chat_user'];
              $result = $db-&gt;sql_query($sql);
              $row = $db-&gt;sql_fetchrow($result);
              $username = $row['username'];
  
              echo '&lt;div class="chatMsg" style="border-bottom:1px solid black;"&gt;';
              echo '&lt;div class="chatUsr"&gt;'.$username.' says:&lt;/div&gt;';
              echo '&lt;div class="chatUsrMsg" style="float:left;"&gt;'.$msg['chat_msg'].'&lt;/div&gt;';
              echo '&lt;div class="chatMsgTime" style="float:right;"&gt;'.date("g:i a", $msg['chat_time']).'&lt;/div&gt;';
              echo '&lt;/div&gt;';
              echo '&lt;br /&gt;';
              echo '&lt;hr /&gt;';
          }
      }
      else
      {
          echo '&lt;div class="chatMsg"&gt;Nothing is heard but the sound of crickets...&lt;/div&gt;';
      }
      ?&gt;
      &lt;/div&gt;
      &lt;div id="alli"&gt;
      &lt;?php
      $chatMsgs = array();
      $limit = time()-86400;
  
      $sql = 'SELECT COUNT(chat_id) as count FROM '.CHAT_TABLE.' WHERE chat_channel = 1 AND chat_time &gt; '.$limit;
      $result = $db-&gt;sql_query($sql);
      $row = $db-&gt;sql_fetchrow($result);
      $count = $row['count'];
  
      if($count &gt; 0)
      {
          $sql = 'SELECT * FROM '.CHAT_TABLE.' WHERE chat_channel = 1 AND chat_time &gt; '.$limit.' ORDER BY chat_time DESC';
          $result = $db-&gt;sql_query($sql);
          while($row = $db-&gt;sql_fetchrow($result))
          {
              $chatMsgs[] = array(
                  'chat_time' =&gt; $row['chat_time'],
                  'chat_msg' =&gt; $row['chat_msg'],
                  'chat_user' =&gt; $row['chat_user'],
                  'chat_channel' =&gt; $row['chat_channel']
              );
          }
  
          foreach($chatMsgs as $msg)
          {
              $sql = 'SELECT username FROM '.USERS_TABLE.' WHERE user_id = '.$msg['chat_user'];
              $result = $db-&gt;sql_query($sql);
              $row = $db-&gt;sql_fetchrow($result);
              $username = $row['username'];
  
              echo '&lt;div class="chatMsg" style="border-bottom:1px solid black;"&gt;';
              echo '&lt;div class="chatUsr"&gt;'.$username.' says:&lt;/div&gt;';
              echo '&lt;div class="chatUsrMsg" style="float:left;"&gt;'.$msg['chat_msg'].'&lt;/div&gt;';
              echo '&lt;div class="chatMsgTime" style="float:right;"&gt;'.date("g:i a", $msg['chat_time']).'&lt;/div&gt;';
              echo '&lt;/div&gt;';
              echo '&lt;br /&gt;';
              echo '&lt;hr /&gt;';
                      }
      }
      else
      {
          echo '&lt;div class="chatMsg"&gt;Nothing is heard but the sound of crickets...&lt;/div&gt;';
      }
      ?&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I'm going to add a parameter to the getChat jquery function to switch back and forth, but with what i have, i'm stuck. Can anyone point me in the right direction?</p>