[eluser]MMCCQQ[/eluser]
dont work i dont know what happed
<a href="#" onclick="Setinbox('read','<?=$row->id;?>');">Click Aqui</a>
this is JS , i trying to design a inbox like FaceBook
Code:
function Setinbox(set,id){
var set = document.getElementById(set);
if(!set.className){
var url = "/inbox/Setread";
var pars = "id="+id;
var ajax = new Ajax.Request( url, {
parameters: pars,
method:"get",
onSuccess: function(){
set.setAttribute("class", "new");
}
}
);
}
else{
var url = "/inbox/Setread";
var pars = "id="+id+"&read=0";
var ajax = new Ajax.Request( url, {
parameters: pars,
method:"get",
onSuccess: function(){
set.setAttribute("class", "");
}
}
);
}
}