↑
Main Page
Line Number
var oXmlDom = document.implementation.createDocument(“”,””,null);
oXmlDom.parseError = {
valueOf: function () { return this.errorCode; },
toString: function () { return this.errorCode.toString() }
};
oXmlDom.__initError__();
oXmlDom.addEventListener(“load”, function () {
this.__checkForErrors__();
this.__changeReadyState__(4);
}, false);
return oXmlDom;
} else {
throw new Error(“Your browser doesn’t support an XML DOM object.”);
}
}
if (isMoz) {
Document.prototype.readyState = 0;
Document.prototype.onreadystatechange = null;
Document.prototype.__changeReadyState__ = function (iReadyState) {
this.readyState = iReadyState;
if (typeof this.onreadystatechange == “function”) {
this.onreadystatechange();
}
};
Document.prototype.__initError__ = function () {
this.parseError.errorCode = 0;
this.parseError.filepos = -1;
this.parseError.line = -1;
this.parseError.linepos = -1;
this.parseError.reason = null;
this.parseError.srcText = null;
this.parseError.url = null;
};
Document.prototype.__checkForErrors__ = function () {
if (this.documentElement.tagName == “parsererror”) {
var reError = />([\s\S]*?)Location:([\s\S]*?)Line Number (\d+), Column
(\d+):<sourcetext>([\s\S]*?)(?:\-*\^)/;
reError.test(this.xml);
this.parseError.errorCode = -999999;
this.parseError.reason = RegExp.$1;
464
Chapter 15
18_579088 ch15.qxd 3/28/05 11:42 AM Page 464
Free JavaScript Editor
Ajax Editor
©
→