Cercando di usare il servizio openweathermap.org ogni volta che effettuo una chiamata ricevo sempre "Chiamata fallita:error"
Sotto ci sono i sorgenti :/ HELP ME
index.html
location.jscodice:<!DOCTYPE html> <html> <head> <title>Weather</title> </head> <body"> <div id="geolocation">Finding geolocation...</div> <input type="submit" value="Vai" onClick="onLoad()" /> <script type="text/javascript" src="js/jquery.js"></script> <script type="application/javascript" src="js/location.js"></script> </body> </html>
codice:function onLoad() { var url = 'http://api.openweathermap.org/data/2.5/weather?q=Angri&mode=xml&units=metric'; $.ajax({ type: "GET", url: url, dataType: "xml", success:function(xml) { $('#geolocation').html(xml); $(xml).find("city").each(function(){ var name = $(this).find('name').text(); $('#geolocation').html(name); }); alert('2'); }, error: function(richiesta,stato,errori){ $('#geolocation').html("Chiamata fallita:"+stato+" "+errori); } }); }


Rispondi quotando
