HTML5 APPLICATIONS DEVELOPMENT MANUAL

(lu) #1

Let’s replace the lat, lon and the appid, each one of you with his own


current location coordinates, and his own API key.


I am replacing the coordinates with my curent location Iasi latitude


47.151726 and longitude 27.587914 and my API default key.


lat=47.151726&lon=27.587914&appid=xxxxxxxxxxxxxxxxxxxxxxxxx


!Note: make sure to take in copy the url and open it in a new tab


In my case:


http://api.openweathermap.org/data/2.5/weather?


lat=47.151726&lon=27.587914&appid=xxxxxxxxxxxxxxxxxxxx


We can see the data that we can use for our app. Now we need to wire


this url in our script.


Let’s create a variable outside of the function for our API key called


var API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";


Use the key each one of you has on his account.

Free download pdf