Hi
I want to return my ajax value as a variable with "return" keyword. But i don't know why i can't do it!!! It return an "undefined"!! It can't return my page content!!
I use this code:
PHP Code:
function ajaxPostRef(urlparams )
{
    if( 
navigator.appName == "Microsoft Internet Explorer")
     {
        var 
http = new ActiveXObject("Msxml2.XMLHTTP");
     }
     else
     {
         var 
http = new XMLHttpRequest();
     }

    
http.open("POST"urltrue);

    
http.setRequestHeader("Content-type""application/x-www-form-urlencoded");
    
http.setRequestHeader("Content-length"params .length);
    
http.setRequestHeader("Connection""close");
    
http.onreadystatechange = function() {//Handler function for call back on state change.
        
if (http.readyState == 1)
        {
            
//
        
}

        if( 
http.readyState == && http.status==200 )
        {
                        return 
http.responseText;
        }
    }

    
http.send(params);