PDA

View Full Version : Problem with callback in Ext.util.JSONP.request



Aedis
2 Sep 2011, 5:27 AM
I have these two pieces of code, the first one is from the twitter app demo for sencha touch and the second one would be my code modified for it to work with a server i'm trying to query.

Now the problem is, both codes work perfectly in a normal web browser, but when using it on Android, I get no callback! this happens ONLY on my modified code which why I find it extremely wierd.


refresh_timeline = function(){
console.log("STARTING REFRESH FUNCTION");
Ext.util.JSONP.request({
url: 'http://search.twitter.com/search.json',
params: {
q: "sencha touch",
rpp: 30,
uniqueify: Math.random()
},
callbackKey: 'callback',
callback: function(data){
console.log("JSONP CALLBACK!!")
var resultados = data.results;
Promociones.update(resultados);
}
});


refresh_timeline = function(){
console.log("STARTING REFRESH FUNCTION");
Ext.util.JSONP.request({
url: 'http://www.santiagourmet.com/anuncios/anunindex',
params: {
uniqueify: Math.random()
},
callbackKey: 'callback',
callback: function(data){
console.log("JSONP CALLBACK!!")
var resultados = data.rest;
Promociones.update(resultados);
}
});


I've been staring at these lines of codes for a while now, we've been changing data here and there with the php but without knowing exactly what we're going against.

any help would be truly appreciated.

pd. not sure if it changes anything, but the script is running on phonegap.