There could be many reasons why it doesn’t work as expected.
First of all the W3C Geolocation API needs to be supported by your browser. This feature is a Web Standard and has been integrated by all major Software vendors into the current browser versions.
Furthermore it needs to be enabled in your browser or OS settings. Please refer to the respective Software Support pages for help.
Please note that the detection of your location needs to be permitted for every website on first start.