开发者

how to test the Geo location identifier feature?

开发者 https://www.devze.com 2023-02-18 20:18 出处:网络
I have jut implemented the GEO location identifier using the GEO IP AP开发者_开发技巧I?... could you please suggest how to test this feature... i am in new york... when i open up the site, its showing

I have jut implemented the GEO location identifier using the GEO IP AP开发者_开发技巧I?... could you please suggest how to test this feature... i am in new york... when i open up the site, its showing me th New York... But i don't know how to check for other cities... Please suggest.


You should be able to test other locations with a proxy service.


The second parameter for getCurrentPosition() is a callback for the failure case. In the third parameter you can set for how many seconds the browser should wait for a response (in my example 5 sec) and how long the result should be cached (in my example 1 h).

navigator.geolocation.getCurrentPosition(function(position) {
    alert('Success');
}, function() {
    alert('Fail!!!');
}, {maximumAge:60000, timeout: 5000});


Try using proxy server or for testing purpose can try to hardcode ip's of different geographical locations in your application. For list of public proxies, check the below link. http://hidemyass.com/proxy-list/1

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号