Sample: dhtmlxAjax Sending GET/POST request with dhtmlxAjax dhtmlxAjax main page
X

Add your own parameters and submit AJAX Request*. Output will contain xml with all parameters server got.

Parameters:    Use Synchronous Mode

 
<script>
 
    //function for processing response
    function outputResponse(loader){
        if(loader.xmlDoc.responseXML!=null)
            alert(loader.doSerialization());
        else
            alert("Response contains no XML");
    }
    
    //send async GET request
    dhtmlxAjax.get("process.php?param1=value&param2=value",outputResponse);
    
    //send async POST request
    dhtmlxAjax.post("process.php","param1=value&param2=value",outputResponse);
    
    //send sync GET request
    var loader = dhtmlxAjax.getSync("process.php?param1=value&param2=value");
    
    //send sync POST request
    var loader = dhtmlxAjax.postSync("process.php","param1=value&param2=value");
</script>
* - this sample requires PHP to run correctly and show what it has to show. Unfortunately there is no possiblity to process submitted parameters and output results wthout server side programming. But syntax which was demonstrated in this sample suits for ststic XML files also.