javascript - Ajax request Canceled in Tizen's emulator, but not in browser -
i have error tizen emulator when try contact webservice
through $.getjson
.
i have button, when click on it, json webservice
, simple that. on computer browser, works perfectly, when run code app on tizen's emulator (gear), get
method returns : (canceled) request cancelled
.
here's code (main.js):
$(window).load(function(){document.addeventlistener('tizenhwkey', function(e) { if(e.keyname == "back") tizen.application.getcurrentapplication().exit(); }); $('.button').click(function(){ callwebservice();//calls webservice return false; }); function callwebservice(){ //works on desktop's chrome $.getjson( "https://www.googleapis.com/freebase/v1/text/en/bob_dylan", function( data ) { $('#ol_home_products').html(data.result); }) .fail(function( err ) { //never called console.log( err ); }); } });
i can see cancel error in networks's tab, nothing shows in console. don't know problem in tizen gear emulator, code works in browser.
thanks.
edit : config.xml, privilege internet here.
<?xml version="1.0" encoding="utf-8"?><widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/myapp" version="1.0.0" viewmodes="maximized"> <tizen:application id="jvqvrz7h1v.myapp" package="jvqvrz7h1v" required_version="2.2"/> <content src="index.html"/> <feature name="http://tizen.org/feature/screen.size.all"/> <icon src="icon.png"/> <name>myapp</name> <tizen:privilege name="http://tizen.org/privilege/internet"/>
i got solution tizen developers' forums. didn't set internet privilege , access domain in config.xml
.
here's correct file :
<?xml version="1.0" encoding="utf-8"?> <widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/myapp" version="1.0.0" viewmodes="maximized"> <tizen:application id="jvqvrz7h1v.myapp" package="jvqvrz7h1v" required_version="2.2"/> <access origin="*" subdomains="true"/> <content src="index.html"/> <feature name="http://tizen.org/feature/screen.size.all"/> <icon src="icon.png"/> <name>myapp</name> <tizen:privilege name="http://tizen.org/privilege/internet"/> </widget>
Comments
Post a Comment