Geolocation Taking Ages



I’m working on the FCC weather challenge but I am severley hampered by the time it takes for my co-ords to come through. It is never instant and can take anything from 20secs to never for the co-ords to come through from my JavaScript request to come through - clearly the whole objective is to get lat/long from a gelocation request and then use the data to get the weather. But it’s pain in the but waiting for the co-ords to come through - is there something wrong with mys script or is something external like my browser?

I opened the Codepen link in my browser (Chrome) and it got the geolocation instantly. Must be something on your end.

Are you still having problems with this?

Try taking your code outside of the document ready. You are waiting for the entire page to load before requesting info. If you have a slow connection, it might take several seconds for the background images to load.