How to get location in codepen?

How to get location in codepen?


I am stuck on weather application, i first created code on my pc but then when i copy pasted that on codepen they are saying that “getCurrentPosition” is not supported.
So how can i enable that or is there any other way to get the position of user?
Thank you!


This is likely an issue with Chrome (assuming you are using the chrome browser). A search of the forums brings up a few different solutions and discussions of this issue. The link I provided was specifically for issues with the weather app and chrome, so if you are not using chrome, you may need to search using other terms.

Hope this helps!


yes this is issue only with chrome, i tried to run it with firefox and it runs perfectly.
and thanks for the link it will help a log.:smile:


Hi, mine worked ok in codepen, but I had to use https for it to work, this meant I had to use an API that supported it. The issue with chrome is that it won’t allow insecure geolocation so it will never work without https.

The API was