Hi
I want to get the weather information to use ajax in my Tizen wearable application, but it do not work.
The error message is that
Setting the debugging URL... > Fail
Error occurred at the below step.
`Setting the debugging URL...`
(Return Code:1102)Cannot read response content.
I already enrollment access '*' and 'true', but it didn't work too.
Code:
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Weather API</title>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<script src="js/jquery.min.js"></script>
<script>
jQuery(document).ready(function($) {
$.ajax({
url : "http:"+"//api.openweathermap.org/data/2.5/weather?q=seoul&APPID=c3c02a7bf6a05a0e88d10ec50dcf6efb",
dataType : "json",
success : function(parsed_json) {
var weather = parsed_json.weather;
var weather_s = "<p>Weather:" +weather[0].main+"</p>";
weather_s += "<p> Info: " + weather[0].description+"</p>";
weather_s += "<img src=\"http:"+"//openweathermap.org/img/w/" + weather[0].icon + ".png\">";
$("#weatherinfo").append(weather_s);
var temp = parsed_json.main;
var temp_s = "<p>Temp:" + Math.round(10*(temp.temp -273.15))/10 +"℃"+"</p>";
$("#weatherinfo").append(temp_s);
},
error: function(e) {
alert("Error");
}
});
});
</script>
</head>
<body>
<div data-role="page">
<div data-role="header">
</div><!-- /header -->
<div data-role="content">
<div id="locationinfo">
</div>
<div id="observinfo">
</div>
<div id="weatherinfo">
</div>
</div><!-- /content -->
</div><!-- /page -->
</body>
</html>
Plz help me. thanks.