Last active
December 11, 2015 08:58
-
-
Save cschmidt/4577035 to your computer and use it in GitHub Desktop.
Use the MaxMind GeoIP Javascript API to assign the country to a hidden form field
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://j.maxmind.com/app/country.js" charset="ISO-8859-1" type="text/javascript"> | |
</script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$('#country').val(geoip_country_code()); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment