XMLHttpRequest.open参数的URL可以是本地文件吗
code=[JScript]
var xmlHttp;
function createXMLHttpRequest() {
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}
function startRequest() {
createXMLHttpRequest();
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.open("GET", "f:/teatajax/simpleResponse.xml", true);//这里这样写为什么不能得到?
xmlHttp.send(null);
}
[/code]
我下了一个基础练习的代码,把html和xml文件放在一个目录,但是访问不了xml文件,url只能访问服务器的文件吗?