January 2018
Beginner
658 pages
13h 10m
English
Now we'll need to pass in some arguments, including a callback function and inside getWeather variable in weather file. We'll need to use those arguments instead of a static lat/lng pair. And we'll also need to call the callback instead of using console.log. The first thing we'll do before we actually change the weather.js code is change the app.js code. There are three arguments to be added. These are lat, lng and callback.
First up we'll want to pass in the latitude. We'll take the static data, like the latitude part from the URL in weather.js, copy it, and paste it right inside of the arguments list in app.js as first argument. The next one will be the longitude. We'll grab that from the ...
Read now
Unlock full access