Help in weather app

Just started making weather application. But it is not working please help me…
here is my code link:link

navigator.geolocation.CurrentPosition is not a function. I believe you meant:

navigator.geolocation.getCurrentPosition(gotLocation);

i tried what you suggested but still not working.

Well, codepen.io was loaded over HTTPS but you are trying to access the OpenWeatherMap api over a non-secure protocol (HTTP).
A workaround would be adding crossorigin.me - This website is for sale! - crossorigin Resources and Information.

api_url=‘https://crossorigin.me/http://api.openweathermap.org/data/2.5/weather?lat=‘+lat+’&lon=‘+lon+’&appid=a7cfaa7e3f452ac8a059ea17fd256b03’;

oh yeah!! Thank you. it is displaying the results but don’t know what the result exactly meant… can you check the new link again now https://codepen.io/shwetarajput012/pen/dXgazR?editors=0010

You get the temperature. The value is in Kelvin degrees if you do not specify the format when requesting data from OpenWeatherMap.
Check more about their API here: http://openweathermap.org/current

thank you for the help.:slight_smile:

it is now displaying the result in celcius as i wanted. But i want to ask one more thing is that it is displaying 25.6 degree celcius but when i look for temperature in other application they are showing 33 degree celcius. Why is that so? And thank YOU for the help so far.

Do not use other application to compare your results. If you are using OpenWeatherMap, then it would be better you compare your results there: http://openweathermap.org/find?q=

Probably other applications get their data from different sources, update data slower or not accurately. Who knows.

oh yes it worked thank you.