Post by altair on Jun 12, 2015 8:24:36 GMT 10
Yes I will send the response. It is here: api.openweathermap.org/data/2.5/weather?lat=26.1555063&lon=50.578267&callback=jQuery1113006507901358418167_1433419269256&_=1433419269257 I tried up something and ended up here:
function getData(position) { document.getElementById("statusText").innerHTML = "Loading..."; $.ajax ({ url : "http://api.openweathermap.org/data/2.5/weather?lat=" + position.coords.latitude + "&lon=" + position.coords.longitude, dataType : "jsonP", success : function(parsed_json) { var country = parsed_json['sys']['country']; var place = parsed_json['name']; var current = Math.floor(parsed_json['main']['temp'] - 272.15); var caption = parsed_json."weather".description; document.getElementById("content-frame").src = "html/mainPage.html?country=" + country + "&location=" + place + "¤t=" + current + "&caption=" + caption; } }); proceed();
}
Altair - The Flying One
|
|
Post by Imformas on Jun 12, 2015 14:47:09 GMT 10
try using the parsed_json as a function with propertys so parsed_json.sys.country and so on
Programming language'sCSharpC++CObjective-CVBProject'sSharpMediaSharpEditYoutifygithub.com/Stephen-Fox-0
|
|