Frage

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.

War es hilfreich?

Lösung

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top