×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    47

    Exclamation Problem in loading xml data

    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..

  2. #2
    Registered User
    Join Date
    Dec 2008
    Posts
    47

    Re: Problem in loading xml data

    hi all,
    i hot what's the error.sorry for disturb u all.
    the error was info.plist network connection.

Similar Threads

  1. Parsing xml data from the server using kxml2 in J2ME
    By dninsiima in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2010-03-26, 08:08
  2. very strange problem with marshal
    By sstoica in forum Symbian
    Replies: 3
    Last Post: 2008-05-20, 20:54
  3. Problem in recieving AES encrypted data
    By mobile_don in forum Symbian Networking & Messaging (Closed)
    Replies: 18
    Last Post: 2007-12-17, 12:08
  4. Problem in reveiving CIMD message with ":" within data
    By kunal_the_one in forum General Messaging
    Replies: 0
    Last Post: 2005-08-04, 07:09
  5. i have a PDU user data coding converted problem......
    By torto in forum Smart Messaging
    Replies: 1
    Last Post: 2002-10-07, 09:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×