Hello people I have a problem with id I can not update an ID in case there is a message without seeing as well as facebook
I want the user id to be updated but it does not work. I hope friends help me
HTML:
<div id="'.$fila['userID'].'" class="Pending_messages_user"></div>
JS:
function actualizar(){
var user_id = $(this).attr("id");
var datauser = 'user_id='+ user_id ;
$.ajax({
type: 'POST',
url: 'codigo.php',
data: datauser,
success: function(respuesta) {
//Pegamos el contenido de update2.php en la div id#Pending_messages_user
$('.Pending_messages_user').html(respuesta);
}
});
}
setInterval( function(){
actualizar();
},1000)//Actualizamos cada 1 segundo