dhtmlx Ajax 是 dhtmlx JavaScript 项目组一个封装了 Ajax 的 JavaScript 包。主要的特性有:
下面是使用 dhtmlxAjax 进行 Ajax 调用的示例:
<script></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¶m2=value",outputResponse);
//send async POST request
dhtmlxAjax.post("process.php","param1=value¶m2=value",outputResponse);
//send sync GET request
var loader = dhtmlxAjax.getSync("process.php?param1=value¶m2=value");
//send sync POST request
var loader = dhtmlxAjax.postSync("process.php","param1=value¶m2=value");