Open weather api help

Hey folks. I did the weather app using the FCC weather api. However I’m trying to build my actual portfolio now. So I want to use open weather’s api. For some reason I just can’t get it to work.

Can anyone point me in the right direction?

I visit your link and request to detect my coordinate appear but nothing happen afterward.

Maybe you should check how you make use of the coordinate you get

You are missing an “=” in the following line. Hint: It is one of the query parameters.

 $.getJSON("" + position.coords.latitude + "&lon" + position.coords.longitude + "&APPID=4889d7d4321e890d61cd3f4c2683c52e"

I can’t believe I missed that :’(



I’ve edited the code:

function showPosition(position) {
    $.getJSON("" + position.coords.latitude + "&lon=" + position.coords.longitude + "&APPID=[API_KEY]",
        function (forecast) {

function getLocation() {
    if (navigator.geolocation) {
    } else {
        document.getElementById("location").innerHTML("Geolocation is not supported by this browser.");

I get the data into my console, but nothing comes through into the div. doesn’t matter if I use .html or .append

can you explain how to find that code ?

i tried using inspect element but only find the html code

1 Like