In the current Process Orchestration framework, some businesses need to use ajax technology for asynchronous communication. This business mainly adds an extended page of business functions on the Puyuan activity attribute page, this is a very detailed explanation of the API of the General Yuan operation. I will not introduce it much here. Here I will mainly discuss the problems encountered in this operation.
Because ajax is needed to save business functions asynchronously, we know that the core of ajax is
XMLHttpRequest. To use this core object, we need to create this object. The creation of this object is browser-specific, mainly in IE browser. This problem is also caused by IE browser.
The code for creating the xmlHttpRequest object should be as follows:
[Javascript]
Function createXMLHttpRequest (){
// Indicates that the current browser is not ie, such as ns or firefox
If (window. XMLHttpRequest ){
XmlHttp = newXMLHttpRequest ();
} Elseif (window. ActiveXObject ){
Try {
XmlHttp = newActiveXObject ("Msxml2.XMLHTTP ");
} Catch (e ){
Try {
XmlHttp = newActiveXObject ("Microsoft. XMLHTTP ");
} Catch (e ){
Alert ("your browser does not support ajax !");
}
}
}
}
If it is not the IE browser, you can simply create a new one, but if it is the IE browser, it will be divided into the situation. If it is 6.0 +, the second method is used, that is, msxml2, if it is 5.5 +, microsoft is used.
However, at present, we usually use ie6.0 or above for development. Therefore, if we often write, we can directly use Microsoft to create the one in the middle.
However, the problem we encountered was that xmlHttp = new ActiveXObject ("Microsoft. XMLHTTP "); xmlHttp = new ActiveXObject (Microsoft. XMLHTTP); this way in other browsers are successfully executed, but on IE there is a problem, and the IE7-9 is no problem, only IE6 problems, because the client to deploy, the customer uses IE6, which is always unsuccessful because the quotation marks are missing due to negligence. Detected because quotation marks are missing. Temporary negligence will waste a long time debugging.
So I wrote this blog and shared it with you. I hope you will pay attention to such issues in the future.