I cut and pasted the contents of the function
getWeather() into the the end of the
foundLocation(position) function and it worked. This may be because the location gets found AFTER you make the ajax call, and that’s why you’re getting problems. By doing the AJAX call inside the foundLocation() function, you ensure that you’re making the call after you get the right coordinates.