Welcome Guest, Not a member yet? Register   Sign In
ajax problem
#1

[eluser]MMCCQQ[/eluser]
dont work i dont know what happed

&lt;a href="#" onclick="Setinbox('read','&lt;?=$row-&gt;id;?&gt;');">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", "");
                                    
                                 }

                                }
                                );
    }
}


Messages In This Thread
ajax problem - by El Forum - 11-15-2007, 10:09 PM
ajax problem - by El Forum - 11-15-2007, 11:21 PM
ajax problem - by El Forum - 11-16-2007, 09:04 AM
ajax problem - by El Forum - 11-16-2007, 09:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB