Last month in the invoicing software, using a lot of the need to get data asynchronously, today is over, hereby recorded
The overall feeling JS made out than jquery, convenient a lot (also may be I use less), but the compatibility aspect really cannot compare with jquery
In addition to the use of jquery during the discovery of a POST request for ASP, there will be a failure of the request, but to get after it can be, so I am quite depressed, which is later I did not choose Jquey to do a step request for a big reason
Here I use asynchronous operations to handle messages that need to be pushed to iOS
var http1;
The browser is used here to determine
if (window. XMLHttpRequest) {
HTTP1 = new XMLHttpRequest ();
}
else {
HTTP1 = new ActiveXObject ("Microsoft.XMLHTTP");
}
Http1.onreadystatechange = function () {
if (http1.readystate = = 4 && http1.status = = 200) {
The output data is obtained here
Flag1 = Http1.responsetext;
alert (FLAG1);
}
}
Http1.open ("POST", "Tools/getptoken.ashx", true);
Http1.setrequestheader ("Content-type", "application/x-www-form-urlencoded");
Http1.send ("type=2&biaoti=" + document.getElementById (' <%=biaoti. ClientID%> '). Value + "&fubiaoti=" + document.getElementById (' <%=fubiaoti. ClientID%> '). Value + "&content=" + editor.text ());
The use of Ajax records in JS