0
我一直试图弄清楚一段时间,我觉得它会变得非常简单。关于发生了什么的小结:从应用程序调用时未定义函数
我从我的内部网络获取.js文件以获取函数。我的函数是在那里定义的,但是当我尝试运行它时,调试器说它没有被定义。我可以从同一个文件运行其他函数,所以我认为这是一个我找不到的语法错误。我附上了下面的代码。请帮我解决这个问题。
在此先感谢!
function getCurrentAds(){
var rs = new XMLHttpRequest();
rs.open("POST", "[WebService]", false);
rs.setRequestHeader("SOAPAction","[WebService]");
rs.setRequestHeader("Content-Type", "text/xml");
var packet = "<?xml version='1.0' encoding='utf-8'?><soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'><soap:Body><GetMajorInfo xmlns='[WebService]' /></soap:Body></soap:Envelope>";
rs.send(packet);
var result = rs.responseXML;
var r = "";
x=result.getElementsByTagName("MJR");
for(i=0;i<x.length;i++)
{
r += "Major Code: " + x[i].getAttribute("Mjr_cd") + "\n";
r += "Description: " + x[i].getAttribute("DES") + "\n\n";
}
rs.close;
alert(r);}