Created
May 14, 2013 11:56
-
-
Save kalkulus/5575383 to your computer and use it in GitHub Desktop.
JavaScript - jQuery code to harvest and format country names and country codes from http://countrycode.org/
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
var list = []; | |
$('#main_table_blue tbody tr').each(function(){ | |
countryName = $(this).find('td:first-child a').text(); | |
countryCode = $(this).find('td:nth-child(3)').text(); | |
list.push('+'+countryCode+' '+countryName); | |
}); | |
$('body').append('<div id="countrycodes"></div>"'); | |
$('#countrycodes').append(list.join('<br />')); | |
console.debug(list); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment