Saturday, 15 February 2014

geolocation - How to display current country and city in HTML with JavaScript -



geolocation - How to display current country and city in HTML with JavaScript -

i looking javascript gives me ability display city , country on application.

like in image below:

i tried many different solutions, through geolocation, , etc., doesn't display anything, know how find right working script, because here found solutions, doesn't display anything!

one of examples below! appreciate help!

thanks in advance

<html> <head> <script language="javascript" src="http://j.maxmind.com/app/geoip.javascript"></script> <script language="javascript"> var city = geoip_city(); var country = geoip_country_name(); </script> </head> <body> <script>document.write(city)</script>, <script>document.write(country)</script>. </body> </html>

you need utilize api this.

check this, see if helps you

http://www.jquery4u.com/api-calls/geolocation-jquery-api-geoplugin/

javascript geolocation

No comments:

Post a Comment