Skip to content

Instantly share code, notes, and snippets.

@MathieuLoutre
Created March 1, 2017 18:06
Show Gist options
  • Save MathieuLoutre/18f19cd2dedda456bce7b16cca2cf125 to your computer and use it in GitHub Desktop.
Save MathieuLoutre/18f19cd2dedda456bce7b16cca2cf125 to your computer and use it in GitHub Desktop.
Basic Geo Targeting
$.getJSON("http://geoip.nekudo.com/api?callback=?", function (res) {
if (res.country && res.country.code === "GB") {
$("#retailer-links").html("<li><a href='https://www.amazon.co.uk/'>Amazon</a></li><li><a href='https://www.waterstones.com/'>Waterstones</a></li>")
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment