【发布时间】:2009-04-20 13:18:55
【问题描述】:
我不断收到以下错误:
未捕获的异常:[Exception...“组件返回失败代码:0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]” nsresult:“0x80004005 (NS_ERROR_FAILURE)”位置:“JS 框架 :: http://site/cms/js/interface.js :: doAjaxCall ::第 300 行”数据:无]
未捕获的异常:[Exception...“组件返回失败代码:0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]” nsresult:“0x80004005 (NS_ERROR_FAILURE)”位置:“JS 框架 :: http://site/cms/js/interface.js :: doAjaxCall ::第 300 行”数据:无]
第 0 行
这是带有 doAjaxCall 的函数
function doAjaxCall(cmd,params) {
var postdata='cmd='+cmd+'¶ms='+params;
var a=sajax_init_object();
if (a) {
a.open("POST","ajax_handler.php", false);
a.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
a.send(postdata); <====Line 300
document.body.style.cursor="default";
if(a.readyState == 4) {
return a.responseText;
} else {
alert("We where unable to execute the ajax call.");
}
}
function sajax_init_object() {
var A;
try {
A=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
A=new ActiveXObject("Microsoft.XMLHTTP");
} catch (oc) {
A=null;
}
}
if(!A && typeof XMLHttpRequest != "undefined")
A=new XMLHttpRequest();
if (!A)
alert("Could not create connection object.");
return A;
}
有什么想法吗?
【问题讨论】:
-
这是否超出了您的域?您使用的是相对网址还是绝对网址?