beta
Hello developer. Login with your existing account. New to Vodafone Developer? Register your account.

+ Login or create an account

0

Hi all, this is my first post.
Please, can anywone analyze the code below and tell me what's wrong?
In the emulator, everything works good, but as soon as i try the code in the device (Nokia N95), it stops at STATUS 2.

I'm really a bit frustrated, thanks to all.

var ajax2=new XMLHttpRequest();
ajax2.open("GET","http://www.google.com/ig/api?weather=" + citta_input, 1);

ajax2.setRequestHeader('Content-type', 'text/xml; charset=utf-8');
ajax2.send(null);
ajax2.onreadystatechange = function()
{

if(ajax2.readyState == 0) {widget.showNotification("Non Inizializzato");}

if(ajax2.readyState == 1) {widget.showNotification("Caricamento...");}

if(ajax2.readyState == 2) {widget.showNotification("CARICATO!!");}

if(ajax2.readyState == 3) {widget.showNotification("...Interazione");}

if(ajax2.readyState == 4) {
widget.showNotification("Completato");
if(ajax2.status == 200) {

// PARSING XML
}
}

1 Answer:

0
I give myself the answer. I post the solution i found for someone else who has my same problem. The Problem was in the manifest and in some trouble that widget Packager does. In security Section via Widget Packager i added "www.google.com", but when it stored, it adds automatically "http://". If i left "http://" in the manifest file , trying to lunch my application, i obtained a security policy exception. Modifying manually the manifest file , leaving only "www.google.com" it worked good.

Login and answer the question