0

Hi I have one function which uses XMLHttpRequest for get data as:

function responseData()
            {           
                console.log("Inside responseData function @@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
                url="http://myURL.asp";

                    var xhr = new XMLHttpRequest();
                    xhr.open('GET', url, true);

                    xhr.onload = function(e)
                    {
                        if (this.status == 200)
                        {
                            console.log("#####################"+this.responseText);

                        }

                        else
                            {
                            console.log ("!!!!!!!!!!!!inside else");
                            }

                    };

                 xhr.send();
            }

Above method works perfect in Android,blackberry ans symbian platform. BUt on Bada I got exception 102. Exception occurs when It try to execute line xhr.send();.I had added Privilege in manifest as:

 <Privileges>
    <Privilege>
        <Name>LOCATION</Name>
    </Privilege>
    <Privilege>
        <Name>HTTP</Name>
    </Privilege>
    <Privilege>
        <Name>ADDRESSBOOK</Name>
    </Privilege>
    <Privilege>
        <Name>SYSTEM_SERVICE</Name>
    </Privilege>
    <Privilege>
        <Name>WEB_SERVICE</Name>
    </Privilege>
</Privileges>

But still getting exception 102. I had also checked it on mobile but same issue. Any suggestion will be appreciated. Thanks in advance.

PPD
  • 5,660
  • 12
  • 52
  • 86
  • If I use xhr.onreadystatechange = function(e) then it goes inside function but now this.status returns 0, and it should return 200. Any idea? – PPD Aug 10 '12 at 12:10

1 Answers1

0

Ok there was a silly mistake in config.xml widget tag was not properly closed.

PPD
  • 5,660
  • 12
  • 52
  • 86