Adding different data to different jquery tabs
<p>i have 2 functions<br>
1- addMessage(): save data into database and is called only on click .<br>
2-updateMessage():get data with ajax from database, called when document is ready ,called every 3 seconds for new data, and called on success of addMessage().</p>

<pre><code>function updateMessage()
{   
    $.ajax({
    url:"db.php",
    type:"post",
    dataType:"text/xml",
    success:function(data)
    {
        $(data).find("message").each(function() {
         var msg_id = $(this).find("msg_id").text();
         var date_time = $(this).find("date_time").text();
         var from_user = $(this).find("from_user").text();
         var from_group = $(this).find("from_group").text();
         var to_user = $(this).find("to_user").text();
         var to_group = $(this).find("to_group").text();
         var msg_type = $(this).find("msg_type").text();
         var msg = $(this).find("msg").text();
         var grp_abr = $(this).find("grp_abr").text();

           var html = "&lt;tr class='blue'&gt;";
         html += "&lt;td&gt;&lt;a href='#' class='bullet' onclick='changeStatus(\""+msg_id+"\")'&gt;&lt;\/a&gt;&lt;\/td&gt;";
         html += "&lt;td&gt;&lt;a href='#' class='reply' onclick='reply(\""+from_user+"\");'&gt;&lt;\/a&gt;&lt;\/td&gt;";
          html += "&lt;td&gt;"+date_time+"&lt;\/td&gt;";
           html += "&lt;td&gt;"+from_user+"["+from_group+"]"+"&lt;\/td&gt;";
           html += "&lt;td&gt;"+to_user+"["+to_group+"]"+"&lt;\/td&gt;";
           html += "&lt;td&gt;&lt;a href='#' class="+msg_type+"&gt;&lt;\/a&gt;&lt;\/td&gt;";
            html += "&lt;td&gt;&lt;a href='#' class='flag_msg' onclick='flagMsg("+msg_id+")'&gt;&lt;\/a&gt;&lt;\/td&gt;";
            html += "&lt;td&gt;"+msg_id+msg+"&lt;\/td&gt;";
            html += "&lt;td&gt;"+grp_abr+"&lt;\/td&gt;&lt;\/tr&gt;";
            });
        }
  });
  setTimeout('updateMessage()',3000);
}
</code></pre>

<p>Now the data retrieved i want to add to different tabs with different names and different containers, how would i do that. My question isn't a matter of code, it is more about logic or sequence of steps.
Any help please.</p>
