0
사용자가 현재 위치 (즉, 리즈, 맨체스터, 런던 등)를 입력 할 수있게하려고합니다. 현재 내가 현재 위치를 알려주려고합니다. 그들이 입력 한 지역의 임시 직원, 그러나 나는 아무것도 표시 할 수 없습니다. 내가 뭔가 잘못하고 있는거야?Wunderground Api 사용자가 자신의 위치를 입력하여 위치를 알려줍니다.
<h3> Weather Data </h3>
<form method="POST" action="about.php">
<!-- user inputs their location here -->
<input type="text" name="location" value= "Country"/>
<input type="text" name="city" value='City'/>
<input type="submit" name="submit" value="submit" />
</form>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script>
jQuery(document).ready(function($) {
$.ajax({
url : "http://api.wunderground.com/api/5e8af95dbdebbd73/geolookup/conditions/forecast/q/UK/England.json",
dataType : "jsonp",
success : function(parsed_json) {
var location = parsed_json['location']['city'];
var temp_f = parsed_json['current_observation']['temp_f'];
alert("Current temperature in " + location + " is: " + temp_f);
}
});
});
</script>
스크립트 위 wunderground에 대한 API 호출이 당신이 여기입니다 호출이 반환하는 개체 중 하나라고 생각 구조를 반환하지 않습니다 임시 기능