Ajax synchronization requests generally follow this:
Copy Code code as follows:
var conn = Ext.lib.Ajax.getConnectionObject (). Conn;
Conn.Open ("POST", ' Http://localhost:8080/struts2study/TreeDDGet?node=-1 ', false);
The Conn object here is actually the XMLHttpRequest object.
Conn.setrequestheader ("Content-type", "application/x-www-form-urlencoded;charset=utf-8");
Conn.send ("start=" + 0 + "&limit=" + 30);
var Rootjson = Conn.responsetext;
General parameter passing through the URL behind the background can also be taken, but see send parameters can also be sent parameters, test the server side to accept the sending parameters, in the Firebug see send the request post part is a string, not too much like the normal parameters sent. Search for a long time did not find a way, and then found an article introduced the XMLHttpRequest object's Send method explanation, just know need to set a header property Content-type tell the server is the form to send data, The parameter string in the Send method is then interpreted by the server.