Unable to define my lat and lon variables

here is my link to my codepen weather api


how can i define my lat and lon variables from the function inside the getJSON function

You want to set a fixed value to lat and lon or you want to take those values from the user?

when a user visits my page i want his computer to set the values for the lat and lon variables

Try to read this documentation from Mozilla Developer Network and let me know if you have any problems with it!