HELP PLEASE -- Weather App Project

HELP PLEASE -- Weather App Project
0.0 0

#1

I’ve spent around 8 hours on this and I feel like I’m incredibly stuck. I stripped all the styling down to the bare minimum, I need help understanding the JS and jQuery stuff.

What I don’t understand is how to manipulate the DOM with the location/weather/temp data with jQuery.

I think I have the basic skeleton relatively correct, I need a nudge in the right direction with what to do with the API info and passing it tot he DOM.

I am most very grateful for your help!


HELP PLEASE - Weather App Project
#2

You do not have any weather data yet, because you have not made a request to a weather API. Inside the navigator.geolocation.getCurrentPosition callback function you have variables lat and long, so you will need to find a weather API which uses lat and long to retrieve the data. You can use $.ajax to make the request and use the variable api as the url for the request. Read about $.ajax and see if you can try to use it in your solution. If you get stuck, let us know.


#3

I’m attempting to use the API provided by free code camp https://fcc-weather-api.glitch.me/

is it as simple as putting this inside the navigator.geolocation.getCurrentPosition callback?

var api = https://fcc-weather-api.glitch.me/api/current?lon=:longitude&lat=:latitude; // ???


#4

That is part of it, but you will need to use the $.ajax jQuery method and then use your created api variable above as the url to request.


#5

Still working on this, standby…