• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Ajax not work in Android?

Hi, I'm using phonegap with Ajax to call external xml file using
XMLHttpRequest. I send the request but response not come.The ready.status comes 403 in android device.
what is the problem.... below is the my code. this code work in
emulator but not work in android 3.1 tablet...
function appReady(){
var ajax = new XMLHttpRequest();
ajax.open("GET","http://search.twitter.com/search.json?
q=phonegap
",true);
ajax.send();

ajax.onreadystatechange=function(){
if(ajax.readyState==4 && (ajax.status==200||
ajax.status==0)){ alert('asdas');
eval('var data = ' + ajax.responseText + ';');
var theResults = data.results;
var theHTML = '';
for(var i=0;i<theResults.length;i++){
theHTML += ['<div class="tweet"',
'<div class="avatar"> <img
src='+theResults.profile_image_url+' /></div>',
'<div
class="tweet_content">',

'<h2>'+theResults.from_user+'</h2>',

'<p>'+theResults.text+'</p>',
'</div>',
'</div>'].join('');
}
document.getElementById('main').innerHTML =
theHTML;
}
}
}
appReady();
 
I've moved this to the Applications Development forum so the devs that hang out here can help you out.:)
 
Back
Top Bottom