gpt4 book ai didi

php - Ajax 问题?与 activexobjects

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:48:58 24 4
gpt4 key购买 nike

我不断收到以下错误:

uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://site/cms/js/interface.js :: doAjaxCall :: line 300" data: no]

uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://site/cms/js/interface.js :: doAjaxCall :: line 300" data: no]

第 0 行

这是 doAjaxCall 的函数

function doAjaxCall(cmd,params) {
var postdata='cmd='+cmd+'&params='+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;
}

有什么想法吗?

最佳答案

由于 Javascript 中的安全限制,无法通过 XMLHttpRequest 从远程域检索信息。我想你需要一个代理!

关于php - Ajax 问题?与 activexobjects,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/768210/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com