javascript - PhoneGap / Android WebView throws "Unknown chromium error: 0" -
i'm developing project using phonegap , need ajax request local webserver has already:
php code
header('access-control-allow-origin: *');
anyway, when ajax request jquery on android error (in adb logcat):
d/chromium(23078): unknown chromium error: 0
the javascript code is:
$.ajax({url:"http://192.168.1.219/works/privati/folder/api.php/getlastmaginfo",datatype:"json",success:function(data) { console.log("finished loading ajax"); console.log(data); }});
in ripple emulator works expected, in android nope.
any suggestion? thank help!
update 2013-08-21:
after researches came @ conclusion $.ajax won't work phonegap (don't know why, maybe bug?). must use $.get instead, when request $.get unknown chromium error: -6
read here problem due android's bug webview url mechanism.
i'll continue research until find , working solution
update 2013-08-21 (2): not using works...
var filetransfer = new filetransfer(); filetransfer.download( "http://192.168.1.219/works/privati/qlipmag/api.php/getlastmaginfo", "json.json", function(entry) { console.log("okay"); }, function(error) { console.log(error); } );
error @ new filetransfer();
=> uncaught referenceerror: filetransfer not defined
update 2013-08-22:
it doens't work loading external image:
<img src="http://externalhost.com/image.jpg"/>
same error.
in android manifest file setted permission:
<uses-permission android:name="android.permission.internet" />
i don't know comes problem...
update 2013-08-27: tried same code on phonegap iphone (in iphone emulator) , ajax request successfull when used external website. using external website on android doesn't same result. same error.
anybody can see why? access origin setted fine...
update 2013-08-27 (after 1 hour)
issue solved
actually phonegap doesn't allows ajax request ip addresses, allows requests whitelisted (in config.xml) domains. used production server (with domain) test , worked.
thank anyway guys. hope can help
Comments
Post a Comment