javascript - Phonegap Android with JSONP Not Working -
i'm making phonegap app android jsonp not working on apk. of code in spanish makes no difference.
<!doctype html> <html> <head> <script type="text/javascript" charset="utf-8" src="phonegap.js"></script> <script src="jquery.min.js"></script> <script src="jquery.jsonp-2.4.0.min.js"></script> <script> $(document).ready(function(){ var output = $('#output'); $.ajax({ url: 'http://www.laprepie.com/form/sql/1.php', datatype: 'jsonp', jsonp: 'jsoncallback', timeout: 5000, success: function(data, status){ $.each(data, function(i,item){ var landmark = item.id_sucursal+item.numero+item.direccion; output.append(landmark); }); }, error: function(){ output.text('there error loading data.'); } }); }); </script> </head> <body> <ul id="output"></ul> </body> </html> but when apk (i'm using online apk builder phonegap build.phonegap.com) , install on phone, not work @ all.
on laptop works wonderful.
really need this, making me crazy! thanks!
after loooong night trying understand wrong code.
i used tutorail http://www.gajotres.net/building-a-native-mobile-app-with-phonegap-and-jquery-mobile-1-4/
and compile apk cli system , worked!
no idea why!
Comments
Post a Comment