6

Possible Duplicate:
HTML 5 Geo Location Prompt in Chrome

I've been looking at geolocation in Html 5. I'm using Chrome (12) and am accessing the html file using a path like this: file:///C:/_Development/Examples/Html5/boilerplate.html

I'm getting the little geolocation icon in the search bar that says that the location has been blocked from tracking your location.

Note that I don't have any exceptions setup at all...

Can this be done or do I need to host the file on a web server? If it can't be done, why can't it be done?

Thanks

0

1 Answer 1

8

This is a duplicate of this question:

HTML 5 Geo Location Prompt in Chrome

It seems that chrome has security restrictions on accessing geolocation data locally. You need to host the file to use the data. A workaround with python is available in the previous question.

3
  • Thanks for the referent to the other question. The python option is interesting, didn't know you could do that. I suspect that I will be using that a lot from now on. Your answer's therefore been very valuable! Thanks again!
    – jwwishart
    Jun 13, 2011 at 1:23
  • 1
    No problem. You could also use node to host the file if you wanted to be trendy haha
    – Swift
    Jun 13, 2011 at 1:24
  • I am facing same issue, I cannot switch to python nor can host the page as the content is dynamic and has to be loaded form local drive only. Any other help?
    – Arti
    Jan 16, 2015 at 12:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.