Generally, the parameters can be obtained after the url and the backend, but the send parameter can also be used as the sending parameter. This experiment shows that the server cannot receive the sent parameter, in firebug, we can see that the post part of the sent request is a string, which is not similar to the normally sent parameter. Ajax synchronous requests are generally as follows:
The Code is 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;
Generally, the parameters can be obtained after the url and the backend, but the send parameter can also be used as the sending parameter. This experiment shows that the server cannot receive the sent parameter, in firebug, we can see that the post part of the sent request is a string, which is not similar to the normally sent parameter. After searching for a long time, I did not find a method. Later I found an article that introduced the sending method explanation of the xmlHttpRequest object, so that I knew that I needed to set the Content-Type attribute of the header to tell the server to send data in form mode, then the parameter strings in the send method will be interpreted by the server.