我在ajax中遇到了请求问题。我写了这样的网站脚本:
var url = "http://url/api/render";
if (window.XMLHttpRequest) { //
http = new XMLHttpRequest();
if (http.overrideMimeType) {
http.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) {//ie
try {
http = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
http.open('POST', url, false);
调用该函数后,我收到“拒绝访问”错误。我做错了什么?为了测试,我输入了谷歌地址......同样的错误