There have been some inaccuracies reported in this article which are stated below:
1.
[Inaccuracy] Mentioned in
Chapter 2. The XMLHttpRequest() Object
The responseXML property is said to be the 'same as' responseText otherwise for the MIME type. Please note that the responseXML is actually an object which implements the Document interface i.e the client parses it and the object represents the parsed document.
Correction noted from W3:
If the readyState attribute has a value other than 4 (Loaded), user agents must raise an INVALID_STATE_ERR exception. Otherwise, if the Content-Type header contains a media type (ignoring any parameters) that is either text/xml, application/xml, or ends in +xml, it must be an object that implements the Document interface representing the parsed document. If Content-Type did not contain such a media type, or if the document could not be parsed (due to an XML well-formedness error or unsupported character encoding, for instance), it must be null.
2.
[Inaccuracy] Mentioned in
Chapter 2. The XMLHttpRequest() Object
It is mentioned that getAllResponseHeaders() and getResponseHeader() differ in the headers they receive, which is not so. getResponseHeader(header) returns the corresponding value to the header argument supplied to it as a single string, while getAllResponseHeaders() returns all the HTTP headers as a single string separated by CRLF [Carriage Return Line Feed] pair.
3.
[Inaccuracy] Mentioned in
2nd Part, 1.4 The POST method
'Security' is stated as a field in which POST has an advantage over GET, which is not true. POST, is sent very much the way GET is sent, other than the fact POST data is part of the request while GET is part of the URL, it doesn't make much difference security-wise.
4.
[Additional Info] It has been shown that httpr.open() commonly uses two values for the method attribute. Actually, W3 mentions these minimum methods that a client must support:
Code:
GET PROPPATCH VERSION-CONTROL
POST MKCOL REPORT
HEAD COPY CHECKOUT
PUT MOVE CHECKIN
DELETE LOCK UNCHECKOUT
PROPFIND UNLOCK MKWORKSPACE
UPDATE MKACTIVITY BASELINE-CONTROL
LABEL ORDERPATCH
MERGE ACL
5.
[Update]{Thanks to MrBlueSky for pointing this out}
The createRequestObject () used in this tutorial is not recommended, and it is recommended that you use the following function as it is more browser friendly, more accurate and has wider support for IE7:
Code:
function createRequestObject()
if (typeof XMLHttpRequest != "undefined") {
return new XMLHttpRequest();
} else if (window.ActiveXObject) {
var aVersions = [ "MSXML2.XMLHttp.5.0",
"MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0",
"MSXML2.XMLHttp","Microsoft.XMLHttp"
];
for (var i = 0; i < aVersions.length; i++) {
try {
var oXmlHttp = new ActiveXObject(aVersions[i]);
return oXmlHttp;
} catch (oError) {
//Do nothing
}
}
}
throw new Error("XMLHttp object could be created.");
}
I apologize for the errors. Hope they won't happen again
Sincerely,
Rohan Prabhu