Hello everybody,
i'm new in this forum and also in the development of S60 widgets.

I'm trying to execute an XMLHttpRequest from my widget(tested on the RDA service with a Nokia N95 8gb) and I don't obtain the expected results.

This is the simple code of my request:

var req;

function getXHR()
{
req = null;
try {
req = new XMLHttpRequest();

} catch (ex) {
req = null;
}

return req;
}


function getResp()
{
if(getXHR())
{

req.onreadystatechange = function()
{
if(req.readyState == 4) {
if(req.status == 200) {
document.getElementById('mainView').innerHTML = "<h4>"+req.responseText+"</h4>";
}
else
document.getElementById('mainView').innerHTML = "<h4>"+req.status+"</h4>";
}


}


req.open('GET', 'http://testwidget.site40.net/counter.php', false);
req.send(null);
}

}


I just created this simple code to visualize if the widget works correctly.

The N95 visualizes the value "undefined".

I have seen in many page of this forum if there were some suggestions but I didn't find anything...

I hope that someone could help me.

Thanks a lot, Andrea