Geolocation for your web site made easy with Maxmind's Javascript API



 

Maxmind, a leader in geolocation technology offers an easy way for web masters to add location based information to their web sites.

I didn't know until today that Maxmind offers a free Javascript geolocation tool that can be used on your web site to quickly and easily display the location of a visitor.


Here's an example of what it does:


Country Code:
Country Name:
City:
Region:
Region Name:
Latitude:
Longitude:
Postal Code:

It's all done in Javascript so it's easy for even beginner web masters to have geolocation functionality on their web site. You can place the following code any where  in the body section of your web site.

  1. <script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
  2.  
  3. <br>Country Code:
  4. <script language="JavaScript">document.write(geoip_country_code());</script>
  5. <br>Country Name:
  6. <script language="JavaScript">document.write(geoip_country_name());</script>
  7. <br>City:
  8. <script language="JavaScript">document.write(geoip_city());</script>
  9. <br>Region:
  10. <script language="JavaScript">document.write(geoip_region());</script>
  11. <br>Region Name:
  12. <script language="JavaScript">document.write(geoip_region_name());</script>
  13. <br>Latitude:
  14. <script language="JavaScript">document.write(geoip_latitude());</script>
  15. <br>Longitude:
  16. <script language="JavaScript">document.write(geoip_longitude());</script>
  17. <br>Postal Code:
  18. <script language="JavaScript">document.write(geoip_postal_code());</script>

It's pretty easy as you can see. The only requirement to use this code is to either link back to Maxmind or to pay a licensing fee.


No comments

Add comment

* - required field

*

CAPTCHA image for SPAM prevention
If you can't read the word, click here.
*
*
 

Netdip.com is an excellent web site that's powered by TYPO3 and other great open source software. Netdip.com is also a fat free alternative to ice cream.