Hi all,
I am new to this wrt.i wrote a application for search tags.
Here is my code:
function load() {
document.getElementById('image_div').innerHTML='Loading...';
var what=document.getElementById('what').value;
var where=document.getElementById('where').value;
var req = new XMLHttpRequest();
if (req) {
var url='http://somesite/mobile/index.php?what='+what+'&where='+where;
loadXMLDoc(req, url);
}
}
function loadXMLDoc(req, url) {
req.onreadystatechange = function() {
processStateChange(req);
};
req.open("GET", url, true);
req.send(null);
}
function processStateChange(req) {
if (req.readyState == 4) {
var resultXml = req.responseText;
if(!resultXml && req.status != 200){
alert('problem in loading xml data');
}else{
parseData(req);
}
}
}
function parseData(req) {
document.getElementById('image_div').innerHTML='';
var x = req.responseXML.getElementsByTagName("name");
var y = req.responseXML.getElementsByTagName("area");
var z = req.responseXML.getElementsByTagName("address");
var ph = req.responseXML.getElementsByTagName("telephone");
document.getElementById('content').innerHTML = '';
for (i=0;i<x.length;i++){
var Div = document.createElement("div");
Div.id = 'xmltext';
Div.innerHTML +="<span>"+x[i].childNodes[0].nodeValue+"</span></br>";
Div.innerHTML +=z[i].childNodes[0].nodeValue+"</br>";
Div.innerHTML +=y[i].childNodes[0].nodeValue+"</br>";
if(ph[i].childNodes[0].nodeValue!='No number'){
Div.innerHTML +=ph[i].childNodes[0].nodeValue+"</br>";
}
document.getElementById('content').appendChild (Div);
}
}
this code is working fine on Intenet explorer.
when install on the mobile using RDA "req.status" value is zero.
in browser(ie) it is working fine.
Any ideas.plz help me..

Reply With Quote

