Here is my code
<script>
$(document).ready(function(){
$.ajax({
url: "http://api.wunderground.com/api/ff24502dcdc27a7a/geolookup/conditions/q/CA/San_Diego.json";,
datatype: "jsonp",
success: function(parsed_json) {
var location = parsed_json['location']['city'];
var temp_f = parsed_json['current_observation']['temp_f'];
$("#temp").text("Current temperature in " + location + " is: " + temp_f + " degree");
}
});
$.ajax({
url: "http://api.wunderground.com/api/ff24502dcdc27a7a/forecast/q/CA/San_Diego.json";,
datatype: "jsonp",
success: function(parsed_json){
var forecast = parsed_json['forecast']['txt_forecast']['forecastday'];
for (index in forecast) {
$(".three").text("Current" +forecast[index]['high']);
}
}
});
});
</script>
I tried getting a 3 day and 10 day forecast, 1 day forecast, astronomy summary and 1 day almanac, but none of the code was working, so I've been trying to rework it for just a day temp and 3 day forecast. I've re-written the code in everyway I know possible, and it still isn't working. It doesn't work no matter how I code it. Please help.
<script>
$(document).ready(function(){
$.ajax({
url: "http://api.wunderground.com/api/ff24502dcdc27a7a/geolookup/conditions/q/CA/San_Diego.json";,
datatype: "jsonp",
success: function(parsed_json) {
var location = parsed_json['location']['city'];
var temp_f = parsed_json['current_observation']['temp_f'];
$("#temp").text("Current temperature in " + location + " is: " + temp_f + " degree");
}
});
$.ajax({
url: "http://api.wunderground.com/api/ff24502dcdc27a7a/forecast/q/CA/San_Diego.json";,
datatype: "jsonp",
success: function(parsed_json){
var forecast = parsed_json['forecast']['txt_forecast']['forecastday'];
for (index in forecast) {
$(".three").text("Current" +forecast[index]['high']);
}
}
});
});
</script>
I tried getting a 3 day and 10 day forecast, 1 day forecast, astronomy summary and 1 day almanac, but none of the code was working, so I've been trying to rework it for just a day temp and 3 day forecast. I've re-written the code in everyway I know possible, and it still isn't working. It doesn't work no matter how I code it. Please help.