Last active
August 29, 2015 14:22
Revisions
-
pdincau revised this gist
May 31, 2015 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,5 +12,4 @@ el.attr('href', el.attr(attributes[code])); }); }); }); -
pdincau revised this gist
May 31, 2015 . 1 changed file with 12 additions and 9 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,16 @@ jQuery(document).ready(function() { var attributes = {} attributes["IT"] = 'data-amazon-it'; attributes["GB"] = 'data-amazon-gb'; var url = "http://freegeoip.net/json/ "; jQuery.getJSON(url, function(data) { var code = data.country_code; var links = jQuery('[data-amazon]'); jQuery.each(links, function(index, link) { var el = jQuery(link); el.attr('href', el.attr(attributes[code])); }); }); }); </script> -
pdincau revised this gist
May 31, 2015 . 1 changed file with 5 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,13 @@ var attributes = {} attributes["IT"] = 'data-amazon-it'; attributes["GB"] = 'data-amazon-gb'; var url = "http://freegeoip.net/json/ "; jQuery.getJSON(url, function(data) { var code = data.country_code; var links = jQuery('[data-amazon]'); jQuery.each(links, function(index, link) { var el = jQuery(link); el.attr('href', el.attr(attributes[code])); }); }); -
pdincau created this gist
May 30, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ var url = "http://freegeoip.net/json/ "; jQuery.getJSON(url, function(data) { var code = data.country_code; var links = jQuery('[data-amazon]'); jQuery.each(links, function(index, link) { var el = jQuery(link); if (code == "IT") { el.attr('href', el.attr('data-amazon-it')); } if (code == "GB") { el.attr('href', el.attr('data-amazon-gb')); } }); });