我正在使用phonegap构建一个android应用程序。我想将xml数据从我的主机服务器检索到android应用程序。我的XML文件:http://www.guitarmaddy.com/index.php?option=com_dmxmlexport&catid=8。我想获得所有标签内容和显示在phonegap应用程序。
之前我使用的是:
$(文档)函数(.ready(){
$.ajax({
type: "GET",
url: "www.guitarmaddy.com/index.php?option=com_dmxmlexport&catid=8",
dataType: "xml",
success: function(xml) {
alert("reading xml");
}
});
});
但是它不起作用..未收到警报消息..请建议我链接,我想知道检索xml数据的基础知识。
发布于 2013-04-05 07:43:26
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
$.ajax({
type: "GET",
url: "www.guitarmaddy.com/index.php?option=com_dmxmlexport&catid=8",
dataType: "xml",
success: function(xml) {
alert("reading xml");
}
});
}
这能解决问题吗?
https://stackoverflow.com/questions/15826754
复制