×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    5

    Please! XMLHttpRequest status = 0 return on my 5800







    I just made simple widget
    It load a local xml using AJAX XMLHttpRequest
    working on FF server with WRT







    working on SDK s60 5th as well
    anyway I don't know how I can see Korean character on SDK..
    As you See , All Korean character are broken
    Doesn't it support Korean?









    and...Doesn't work on my phone 5800
    I have no idea what's going on this
    I get a 0 status just only on my phone!
    Isn't there any expert? need help~

    Code:
    var xmlhttp;
    function loadXMLDoc(){
        xmlhttp = null;
        if (window.XMLHttpRequest) {// code for IE7, Firefox, Mozilla, etc.
            xmlhttp = new XMLHttpRequest();
        }
        else 
            if (window.ActiveXObject) {// code for IE5, IE6
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
        if (xmlhttp != null) {
            url = "main.xml";
            xmlhttp.onreadystatechange = onResponse;
            xmlhttp.open("GET", url, true);
            xmlhttp.send(null);
        }
        else {
            alert("Your browser does not support XMLHTTP.");
        }
    }
    
    function onResponse(){
    	//alert("xmlhttp.readyState = " + xmlhttp.readyState);
    	//alert("xmlhttp.status = " + xmlhttp.status);
        if (xmlhttp.readyState != 4) 
            return;
        if (xmlhttp.status != 200) {
            alert("Problem retrieving XML data");
            return;
        }
        var oObj = xmlhttp.responseXML;
        
        var Wek = oObj.getElementsByTagName('CATALOG');
        We1 = Wek[0].childNodes;
        
        for (y = 0; y < We1.length; y++) {
            Wy = We1[y].childNodes;
            for (i = 0; i < Wy.length; i++) {
                Wn = Wy[i].nodeName;
                Wk = Wy[i].childNodes.length;
                for (z = 0; z < Wk; z++) {
                    Wa = Wy[i].childNodes[z].firstChild.nodeValue + "<br>";
                    document.getElementById(Wn).innerHTML += Wa;
                }
            }
        }
    }
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <head>
            <title>Sample Widget</title>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <script language="javascript" type="text/javascript" src="basic.js">
            </script>
            <link rel="stylesheet" href="basic.css" type="text/css">
            <META NAME="Generator" CONTENT="Schedule" />
        </head>
        <body onload="javascript:loadXMLDoc();">
            <div id="tab">
                <table id="week">
                    <tr>
                        <td class="name">
                           시간 / 요일
                        </td>
                        <td width="20%">
                            월
                        </td>
                        <td width="20%">
                            화
                        </td>
                        <td width="20%">
                            수
                        </td>
                        <td width="20%">
                            목
                        </td>
                        <td width="20%">
                            금
                        </td>
                    </tr>
                    <tr>
                        <td class="name">
                            1 교시 [09:00~09:50]
                        </td>
                        <td id="A0">
                        </td>
                        <td id="B0">
                        </td>
                        <td id="C0">
                        </td>
                        <td id="D0">
                        </td>
                        <td id="E0">
                        </td>
                    </tr>
                    <tr>
                        <td class="name">
                            2 교시 [10:00~10:50]
                        </td>
                        <td id="A1">
                        </td>
                        <td id="B1">
                        </td>
                        <td id="C1">
                        </td>
                        <td id="D1">
                        </td>
                        <td id="E1">
                        </td>
                    </tr>
                    <tr>
                        <td class="name">
                            3 교시 [11:00~11:50]
                        </td>
                        <td id="A2">
                        </td>
                        <td id="B2">
                        </td>
                        <td id="C2">
                        </td>
                        <td id="D2">
                        </td>
                        <td id="E2">
                        </td>
                    </tr>
                    <tr>
                        <td class="name">
                            4 교시 [12:00~12:50]
                        </td>
                        <td id="A3">
                        </td>
                        <td id="B3">
                        </td>
                        <td id="C3">
                        </td>
                        <td id="D3">
                        </td>
                        <td id="E3">
                        </td>
                    </tr>
                    <tr>
                        <td class="name">
                            5 교시 [1:00~1:50]
                        </td>
                        <td id="A4">
                        </td>
                        <td id="B4">
                        </td>
                        <td id="C4">
                        </td>
                        <td id="D4">
                        </td>
                        <td id="E4">
                        </td>
                    </tr>
                    <tr>
                        <td class="name">
                            6 교시 [2:00~2:50]
                        </td>
                        <td id="A5">
                        </td>
                        <td id="B5">
                        </td>
                        <td id="C5">
                        </td>
                        <td id="D5">
                        </td>
                        <td id="E5">
                        </td>
                    </tr>
                    <tr>
                        <td class="name">
                            7 교시 [3:00~3:50]
                        </td>
                        <td id="A6">
                        </td>
                        <td id="B6">
                        </td>
                        <td id="C6">
                        </td>
                        <td id="D6">
                        </td>
                        <td id="E6">
                        </td>
                    </tr>
                    <tr>
                        <td class="name">
                            8 교시 [4:00~4:50]
                        </td>
                        <td id="A7">
                        </td>
                        <td id="B7">
                        </td>
                        <td id="C7">
                        </td>
                        <td id="D7">
                        </td>
                        <td id="E7">
                        </td>
                    </tr>
                    <tr>
                        <td class="name">
                            9 교시 [5:00~5:50]
                        </td>
                        <td id="A8">
                        </td>
                        <td id="B8">
                        </td>
                        <td id="C8">
                        </td>
                        <td id="D8">
                        </td>
                        <td id="E8">
                        </td>
                    </tr>
                    <tr>
                        <td class="name">
                            10 교시 [6:00~6:50]
                        </td>
                        <td id="A9">
                        </td>
                        <td id="B9">
                        </td>
                        <td id="C9">
                        </td>
                        <td id="D9">
                        </td>
                        <td id="E9">
                        </td>
                    </tr>
                </table>
            </div>
    Code:
    <?xml version="1.0"?><CATALOG><mon><A0><room>한글</room><professor>a</professor></A0><A1><study>과목</study><room>강의실</room><professor>교수명</professor></A1><A2><study>A3</study><room>A3</room><professor>A3</professor></A2></mon><wed><C3><study>C3</study><room>C3</room><professor>C3</professor></C3></wed><fri><E5><study>E5</study><room>E5</room><professor>aa</professor></E5><E6><study>E6</study></E6></fri></CATALOG>

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Please! XMLHttpRequest status = 0 return on my 5800

    Hi,

    a suggestion about a possible workaround: if you need to read and use local widget's data, you could give a look at JSON. It allows you to specify data in a format that is natively interpreted by JavaScript, so avoiding you the need to load and parse XML (or similar) data files.

    Pit

Similar Threads

  1. XMLHttpRequest status always returns NULL
    By vinothg in forum Symbian
    Replies: 6
    Last Post: 2009-09-22, 09:22
  2. status pane in E61 screen (320x240 ) s603rd
    By francobellu in forum Symbian
    Replies: 2
    Last Post: 2008-07-10, 12:48
  3. problem in view architecture
    By ab in forum Symbian
    Replies: 4
    Last Post: 2007-11-29, 12:46
  4. Controls not showing
    By ab in forum Symbian
    Replies: 0
    Last Post: 2007-11-29, 12:19
  5. Hanging up status problem
    By sueggelh in forum Symbian
    Replies: 0
    Last Post: 2004-09-14, 11:06

Posting Permissions

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