蔭新的PhoneGap,蔭無法獲得響應,同時解析XML Url.what我曾嘗試是,XML解析錯誤的PhoneGap
function initLoginPage() {
var xmlhttp = new XMLHttpRequest();
var urlString = "url/app/api.php?fn=employees";
xmlhttp.onreadystatechange = processData;
xmlhttp.open("GET", urlString, true);
xmlhttp.send();
}
function processData() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
document.getElementById("result").innerHTML=xmlhttp.responseText;
} else{document.getElementById().innerHTML = "<b>Please Wait..</b>";}
}
我呼籲initLoginPage功能,當設備Ready.I必須在listView中顯示Response。 IAM使用URL的JQuery的Mobile.The響應是
<?xml version="1.0" encoding="UTF-8" ?>
<details>
<responsecode>200</responsecode>
<Employee>
<name>name</name>
<Fathername>fathename</Fathername>
<Address>address</Address>
<Number>12342456</Number>
<Enumber>4324421341234</Enumber>
<OfficeMail>[email protected]</OfficeMail>
<PersonalMail>[email protected]</PersonalMail>
<EmployeeID>1</EmployeeID>
<DOB>21-06-1991</DOB>
<DOJ>05-03-2013</DOJ>
<PanNumber>123456</PanNumber>
<image>./images/1380372683.png</image>
</Employee>
</details>
實際上它完整的URL,我沒有提到的域名地址 – geeko