android - "Internal Server Error" with jQuery.ajax using phoneGap -
i'm trying make ajax request phonegap application. i'm new @ stuff, don't know what's wrong code. server needs facebook token connect. working when via 'curl' on terminal, when run on android emulator appears alert: "error: internal server error" localserver running on 10.0.2.2:9000 in android emulator.
function fun(){ fb.getloginstatus(function(response) { if (response.status == 'connected') { var token = response.authresponse.accesstoken; token = '"'+token+'"'; jquery.ajax({ url: "http://10.0.2.2:9000/lists/json", type: "get", data: {"token": token}, datatype: "json", success: function(result) { alert('success.'); }, error: function(xhr, ajaxoptions, thrownerror) { alert('error: '+thrownerror); } }); } else { //not logged in } }); }
any kind of appreciated.
finnally did appending token url of server like:
function fun(){ fb.getloginstatus(function(response) { if (response.status == 'connected') { var token = response.authresponse.accesstoken; jquery.ajax({ url: "http://10.0.2.2:9000/lists/json?token="+token, type: "get", success: function(result) { alert('success.'); }, error: function(xhr, ajaxoptions, thrownerror) { alert('error: '+thrownerror); } }); } else { //not logged in } }); }
and worked :)
Comments
Post a Comment