伊图教程网[www.etoow.com]
http://www.etoow.com/html/2007-08/1187529811-1.html
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Giving up :( Cannot create an XMLHTTP instance');
return false;
}
http_request.onreadystatechange = callback;
http_request.open('GET', url, true);
http_request.send(null);
}
</script>
</body>
</html>
5.运行工程,看看效果吧!
hello.xml(注意:我的xml文档中并没有指定对应的xsl解析文件名)
以下是引用片段:
<?xml version='1.0'?>
灵活调用XSL来解析XML文档(JS异步)
'http://www.etoow.com/html/2007-08/1187529811-1.html