2012-02-24 81 views
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);} 

回答

1

哈!弄清楚了。有点愚蠢的我。我需要清除我正在使用的设备上的应用程序缓存。因此,对于遇到此问题的任何人,请清除缓存,并且它应该都可以工作。现在我需要弄清楚如何清除应用程序关闭时的缓存,以便用户在每次更新我的Web服务时都不需要清除缓存。有任何想法吗?

相关问题