Well that is essentially what I do. In the callback function, if I alert the returned data, it's null. I'm thinking that's because while the user is asked for authorization to connect to the Internet from the app, the ajax call executes at that point in time, and by the time the user authorizes, there is no result to be returned since the ajax already executed.
So I tried setting a very long timeout (60 secs) to give the user enough time to authorize, but even still, the returned result is null.
Code:
$.ajax({
url: 'http://pipes.yahoo.com/pipes/pipe.run?_id=856b9414b753b5d8b9f5bb056f98bb49&_render=json',
dataType: 'json',
type: 'get',
timeout: 60000,
error: function(){
alert('error')
},
success: function(json){
alert('success')
alert(json)
alert('success 2')
},
complete: function(){
alert('complete')
}
})
So the success callback fires, the first alert works, the 2nd returns null, and the 3rd never fires.