So folks ..
I have a code that puts a setInterval of the messages passed between users de
and para
in the function below ..
function openWidChat(de,para) {
var url_s = $("#url_s").val();
$("label#boxC input").val('');
$("label#boxC input").removeAttr('disabled');
$("label#boxC input").attr('user-de',de);
$("label#boxC input").attr('user-para',para);
$("#mensChat div._5chat").fadeIn(400).html('<div class="maxWid_16"><img src="'+ url_s +'/themes/4space/images/load/loadLikesW.gif" alt="" width="16" height="16"></div>');
para = setInterval(function() {
$.ajax({
url: url_s +"/demo/chat/chat.php",
data:'d='+de+'&p='+para+'&url_s='+url_s,
type: "POST",
cache: false,
success : function(html){
$("#mensChat div._5chat").html(html);
}
});
}, 1000);
}
Until then it works fine, but when I click on another user's name to start in the same box a new conversation, the setInterval
is going back and forth on all the users that I clicked to chat ... It gets a go and come on damn ..
Does anyone have a solution for this?