Reputation: 194
This is my code
var a=[];
var chatid=[];
$.ajax({
type:"post",
url:"<?php echo base_url()?>index.php/systemchat/record",
dataType:"JSON",
success:function(data)
{
alert(chatid);
for(i=0;i<data.length;i++)
{
if($.inArray(data[i].user_chatid,chatid) =='-1')
{
var xyz=data[i].user_chatid;
a+='<span>'+data[i].msg+'</span></br>';
}
//ab.push(xyz);
chatid+=xyz;
}
$("#systxtarea").append(a);
}
It Work's fine for index 0-9 But has problem when working for index 10,11,12...and so on
Upvotes: 1
Views: 78