29-1.js
来自「java应用代码和章节代码。各种功能实现效果。很值」· JavaScript 代码 · 共 31 行
JS
31 行
// XML document
var xDoc;
// retrieve XML document as document object
function loadXMLDoc(url) {
var req;
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
req.open("GET", url, false);
req.send(null);
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.open("GET", url, false);
req.send();
}
}
if (req) {
if (req.status == 200) {
xDoc = req.responseXML;
if (xDoc && typeof xDoc.childNodes != "undefined" && xDoc.childNodes.length == 0) {
xDoc = null;
}
} else {
alert("There was a problem retrieving the XML data:\n" +
req.statusText);
}
} else {
alert("Sorry, this browser isn\'t equipped to read XML data.");
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?