function getCountryNameByCode(code) {
var countryName = '';
switch(code) {
case "US":
countryName = "United State";
break;
case "GB":
countryName = "United Kingdom";
break;
case "DE":
countryName = "Germany";
break;
case "CA":
countryName = "Canada";
break;
case "JP":
countryName = "Japan";
break;
case "ES":
countryName = "Spain";
break;
case "FR":
countryName = "France";
break;
case "IT":
countryName = "Italy";
break;
case "CN":
countryName = "China";
break;
case "AT":
countryName = "Austria";
break;
case "AU":
countryName = "Australian";
break;
case "CH":
countryName = "Switzerland";
break;
case "EG":
countryName = "Egypt";
break;
case "FI":
countryName = "Finland";
break;
case "IN":
countryName = "India";
break;
case "IE":
countryName = "Ireland";
break;
case "ID":
countryName = "Indonesia";
break;
case "KH":
countryName = "Cambodia";
break;
case "KR":
countryName = "Korea";
break;
case "MX":
countryName = "Mexico";
break;
case "NL":
countryName = "Holland";
break;
case "NO":
countryName = "Norway";
break;
case "MM":
countryName = "Burma";
break;
case "PH":
countryName = "Philippines";
break;
case "BE":
countryName = "Belgium";
break;
case "GY":
countryName = "Guyana";
break;
case "SE":
countryName = "Sweden";
break;
case "PY":
countryName = "Paraguay";
break;
case "UA":
countryName = "Ukraine";
break;
case "PE":
countryName = "Peru";
break;
case "AE":
countryName = "United Arab Emirates";
break;
case "VN":
countryName = "Vietnam";
break;
case "SO":
countryName = "Somalia";
break;
case "LA":
countryName = "Laos";
break;
case "KW":
countryName = "Kuwait";
break;
case "MY":
countryName = "Malaysia";
break;
case "DK":
countryName = "Denmark";
break;
case "PK":
countryName = "Pakistan";
break;
case "TH":
countryName = "Thailand";
break;
case "HU":
countryName = "HUNGARY";
break;
case "LV":
countryName = "Latvia";
break;
case "RU":
countryName = "Russia";
break;
case "CZ":
countryName = "Czech Republic";
break;
case "PL":
countryName = "Poland";
break;
case "BY":
countryName = "Belarus";
break;
case "LT":
countryName = "Lithuania";
break;
case "LU":
countryName = "Luxembourg";
break;
case "AD":
countryName = "Andorra";
break;
case "AG":
countryName = "Antigua and Barbuda";
break;
case "RO":
countryName = "Romania";
break;
case "AM":
countryName = "Armenia";
break;
case "CV":
countryName = "Cape Verde";
break;
case "DZ":
countryName = "Algeria";
break;
case "RT":
countryName = "Rota (Northern Mariana Islands)";
break;
case "TL":
countryName = "Timor-Leste";
break;
case "MU":
countryName = "Mauritius";
break;
case "ZM":
countryName = "Zambia";
break;
case "BL":
countryName = "St. Barthelemy";
break;
case "SX":
countryName = "St. Maarten, St. Martin";
break;
case "BH":
countryName = "Bahrain";
break;
case "GM":
countryName = "Gambia";
break;
case "MV":
countryName = "Maldives";
break;
case "CK":
countryName = "Cook Islands";
break;
case "RE":
countryName = "Reunion Island";
break;
case "IQ":
countryName = "Iraq";
break;
case "GD":
countryName = "Grenada";
break;
case "FM":
countryName = "Micronesia, Federated States of";
break;
case "VE":
countryName = "Venezuela";
break;
case "NC":
countryName = "New Caledonia";
break;
case "NP":
countryName = "Nepal";
break;
case "MD":
countryName = "Moldova";
break;
case "VA":
countryName = "Vatican City (Italy)";
break;
case "GP":
countryName = "Guadeloupe";
break;
case "GU":
countryName = "Guam";
break;
case "NA":
countryName = "Namibia";
break;
case "QA":
countryName = "Qatar";
break;
case "YT":
countryName = "Mayotte";
break;
case "ME":
countryName = "Montenegro";
break;
case "BT":
countryName = "Bhutan";
break;
case "UZ":
countryName = "Uzbekistan";
break;
case "WF":
countryName = "Wallis & Futuna Islands";
break;
case "JO":
countryName = "Jordan";
break;
case "MK":
countryName = "Macedonia (FYROM)"
break;
case "BF":
countryName = "Burkina Faso";
break;
case "NE":
countryName = "Niger";
case "WL":
countryName = "Wales (United Kingdom)";
break;
case "GE":
countryName = "Georgia";
break;
case "IS":
countryName = "Iceland";
break;
case "ER":
countryName = "Eritrea";
break;
case "KM":
countryName = "Comoros";
break;
case "SN":
countryName = "Senegal";
break;
case "EE":
countryName = "Estonia";
break;
case "MO":
countryName = "Macau";
break;
case "SI":
countryName = "Slovenia";
break;
case "UG":
countryName = "Uganda";
break;
case "ZW":
countryName = "Zimbabwe";
break;
case "TD":
countryName = "Chad";
break;
case "GL":
countryName = "Greenland";
break;
case "AF":
countryName = "Afghanistan";
break;
case "CD":
countryName = "Congo, Democratic Republic of";
break;
case "MN":
countryName = "Mongolia";
break;
case "MR":
countryName = "Mauritania";
break;
case "CO":
countryName = "Colombia";
break;
case "TT":
countryName = "Trinidad & Tobago";
break;
case "SF":
countryName = "Scotland (United Kingdom)";
break;
case "CF":
countryName = "Central African Republic";
break;
case "GI":
countryName = "Gibraltar";
break;
case "KY":
countryName = "Cayman Islands";
break;
case "NI":
countryName = "Nicaragua";
break;
case "TG":
countryName = "Togo";
break;
case "GQ":
countryName = "Equatorial Guinea";
break;
case "KN":
countryName = "St. Kitts and Nevis";
break;
case "ZZ":
countryName = "Tortola (British Virgin Islands)";
break;
case "TZ":
countryName = "Tanzania, United Republic of";
break;
case "KE":
countryName = "Kenya";
break;
case "MH":
countryName = "Marshall Islands";
break;
case "KZ":
countryName = "Kazakhstan";
break;
case "SA":
countryName = "Saudi Arabia";
break;
case "BN":
countryName = "Brunei Darussalam";
break;
case "SY":
countryName = "Syrian Arab Republic";
break;
case "HN":
countryName = "Honduras";
break;
case "PG":
countryName = "Papua New Guinea";
break;
case "HT":
countryName = "Haiti";
break;
case "SM":
countryName = "San Marino";
break;
case "MW":
countryName = "Malawi";
break;
case "CM":
countryName = "Cameroon";
break;
case "MG":
countryName = "Madagascar";
break;
case "PT":
countryName = "Portugal";
break;
case "CR":
countryName = "Costa Rica";
break;
case "BM":
countryName = "Bermuda";
break;
case "SR":
countryName = "Suriname";
break;
case "SB":
countryName = "Solomon Islands";
break;
case "TA":
countryName = "Tahiti (French Polynesia)";;
break;
case "CW":
countryName = "Curacao";
break;
case "TW":
countryName = "Taiwan";
break;
case "SL":
countryName = "Sierra Leone";
break;
case "TU":
countryName = "Truk (Micronesia, Federated States of)";
break;
case "UI":
countryName = "Union Islands (St. Vincent & the Grenadines)";
break;
case "VL":
countryName = "St. Thomas (U.S. Virgin Islands)";
break;
case "NF":
countryName = "Norfolk Island (Australia)";
break;
case "GT":
countryName = "Guatemala";
break;
break;
case "BG":
countryName = "Bulgaria";
break;
break;
case "PO":
countryName = "Ponape (Micronesia, Federated States of)";
break;
case "AW":
countryName = "Aruba";
break;
case "EC":
countryName = "Ecuador";
break;
case "RS":
countryName = "Serbia";
break;
case "BS":
countryName = "Bahamas";
break;
case "BO":
countryName = "Bolivia";
break;
case "PW":
countryName = "Palau";
break;
case "KG":
countryName = "Kirghizia (Kyrgyzstan)";
break;
case "TC":
countryName = "Turks & Caicos Islands";
break;
case "LC":
countryName = "St. Lucia";
break;
case "AZ":
countryName = "Azerbaijan";
break;
case "MT":
countryName = "Malta";
break;
case "BI":
countryName = "Burundi"
break;
case "AO":
countryName = "Angola";
break;
case "CY":
countryName = "Cyprus";
break;
case "BR":
countryName = "Brazil";
break;
case "WS":
countryName = "Samoa Western";
break;
case "AX":
countryName = "Aland Island (Finland)";
break;
case "LR":
countryName = "Liberia";
break;
case "FO":
countryName = "Faroe Islands";
break;
case "UV":
countryName = "St. John (U.S. Virgin Islands)";
break;
case "SG":
countryName = "Singapore";
break;
case "NG":
countryName = "Nigeria";
break;
case "PA":
countryName = "Panama";
break;
case "DJ":
countryName = "Djibouti";
break;
case "SZ":
countryName = "Swaziland";
break;
case "DO":
countryName = "Dominican Republic";
break;
case "KO":
countryName = "Kosrae (Micronesia, Federated States of)";
break;
case "MZ":
countryName = "Mozambique";
break;
case "AS":
countryName = "American Samoa";
break;
case "UY":
countryName = "Uruguay";
break;
case "KT":
countryName = "republic of ivory coast";
break;
case "AL":
countryName = "Albania";
break;
case "CG":
countryName = "Congo";
break;
case "AI":
countryName = "Anguilla";
break;
case "RW":
countryName = "Rwanda";
break;
case "GR":
countryName = "Greece";
break;
case "BW":
countryName = "Botswana";
break;
case "HR":
countryName = "Croatia";
break;
case "SC":
countryName = "Seychelles";
break;
case "NZ":
countryName = "New Zealand";
break;
case "PF":
countryName = "French Polynesia";
break;
case "ML":
countryName = "Mali";
break;
case "VU":
countryName = "Vanuatu";
break;
case "MP":
countryName = "Northern Mariana Islands";
break;
case "TR":
countryName = "Turkey";
break;
case "BA":
countryName = "Bosnia and Herzegovina";
break;
case "LY":
countryName = "Libyan Arab Jamahiriya";
break;
case "SV":
countryName = "El Salvador";
break;
case "TN":
countryName = "Tunisia";
break;
case "SW":
countryName = "St. Christopher (St. Kitts)";
break;
case "AR":
countryName = "Argentina";
break;
case "YE":
countryName = "Yemen, Republic of";
break;
case "TJ":
countryName = "Tajikistan";
break;
case "GA":
countryName = "Gabon";
break;
case "FJ":
countryName = "Fiji";
break;
case "GN":
countryName = "Guinea";
break;
case "GH":
countryName = "Ghana";
break;
case "BD":
countryName = "Bangladesh";
break;
case "TV":
countryName = "Tuvalu";
break;
case "YA":
countryName = "Yap (Micronesia, Federated States of)";
break;
case "LI":
countryName = "Liechtenstein";
break;
case "SP":
countryName = "Saipan (Northern Mariana Islands)";
break;
case "LB":
countryName = "Lebanon";
break;
case "MQ":
countryName = "Martinique";
break;
case "ZA":
countryName = "South Africa";
break;
case "BJ":
countryName = "Benin";
break;
case "OM":
countryName = "Oman";
break;
case "TO":
countryName = "Tonga";
break;
case "SK":
countryName = "Slovakia";
break;
case "BB":
countryName = "Barbados";
break;
case "MA":
countryName = "Morocco";
break;
case "IL":
countryName = "Israel";
break;
case "LK":
countryName = "Sri Lanka";
break;
case "BQ":
countryName = "Bonaire, St. Eustatius, Saba";
break;
case "PR":
countryName = "Puerto Rico";
break;
case "MS":
countryName = "Montserrat";
break;
case "TM":
countryName = "Turkmenistan";
break;
case "KI":
countryName = "Kiribati";
break;
case "GW":
countryName = "Guinea-Bissau";
break;
case "IC":
countryName = "Canary Islands (Spain)";
break;
case "GF":
countryName = "French Guiana";
break;
case "LS":
countryName = "Lesotho";
break;
case "JE":
countryName = "Jersey (Channel Islands)";
break;
case "DM":
countryName = "Dominica";
break;
case "ET":
countryName = "Ethiopia";
break;
case "BZ":
countryName = "Belize";
break;
case "GG":
countryName = "Guernsey (Channel Islands)"
case "JM":
countryName = "Jamaica";
break;
case "NB":
countryName = "Northern Ireland (United Kingdom)";
break;
case "CL":
countryName = "Chile";
break;
case "SD":
countryName = "Sudan";
break;
case "CI":
countryName = "ivory coast";
break;
case "AN":
countryName = "NETHERLANDS ANTILLES";
break;
case "CC":
countryName = "COCOS(KEELING) ISLANDS";
break;
case "CU":
countryName = "CUBA";
break;
case "MC":
countryName = "Monaco";
break;
case "VC":
countryName = "St. Vincent & the Grenadines";
break;
case "HK":
countryName = "HONGKONG";
break;
default:
countryName = code;
break;
};
if(countryName) {
return countryName.toUpperCase();
};
return countryName;
};

JavaScript根据国家二字码获取国家全称的更多相关文章

  1. Java根据国家二字码获取国家英文名称,中文名称实例

    import org.apache.commons.lang.StringUtils; public class CountryUtil { /** * 根据国家二字码获取国家对应的中文(英文,cod ...

  2. 微信小程序通过二维码获取参数运行

    小程序开发过程中会遇到参数id会通过二维码获取,然后执行接口获取数据,但是难免会遇到带过来的参数出现乱码,这样就需要解码,多个参数时就需要进行处理取我们需要的字段值:小程序开发过程中会遇到参数id会通 ...

  3. 网页授权——扫二维码获取openid

    最近做微信公众平台开发项目时遇到这样一个功能需求:生成一个特定url的二维码,用户扫描二维码后跳转到这个url指定的页面,并在这个页面获得用户的openid.这个功能主要涉及到两方面的技术:生成二维码 ...

  4. 微信Netting-QRLJacking分析利用-扫我二维码获取你的账号权限

    首先我们来看一下QRLJacking的实际原理:.攻击者首先进行客户端QR会话,并将登录QR码复制到网络钓鱼网站.“现在,一个精心制作的网络钓鱼页面有一个有效和定期更新的QR码可以被发送给受害者.” ...

  5. QRCode.js:使用 JavaScript 生成微信二维码

    https://www.runoob.com/w3cnote/javascript-qrcodejs-library.html 什么是 QRCode.js? QRCode.js 是一个用于生成二维码的 ...

  6. 【javascript】生成二维码

    1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 < ...

  7. .NET生成小程序码,并合自定义背景图生成推广小程序二维码

    前言: 对于小程序大家可能都非常熟悉了,随着小程序的不断普及越来越多的公司都开始推广使用起来了.今天接到一个需求就是生成小程序码,并且于运营给的推广图片合并在一起做成一张漂亮美观的推广二维码,扫码这种 ...

  8. Python 创建本地服务器环境生成二维码

    一. 需求 公司要做一个H5手机端适配页面,因技术问题所以H5是外包的,每次前端给我们源码,我们把源码传到服务器让其他人访问看是否存在bug,这个不是很麻烦吗?有人说,可以让前端在他们的服务器上先托管 ...

  9. Android 二维码 生成和识别(附Demo源码)

    今天讲一下目前移动领域很常用的技术——二维码.现在大街小巷.各大网站都有二维码的踪迹,不管是IOS. Android.WP都有相关支持的软件.之前我就想了解二维码是如何工作,最近因为工作需要使用相关技 ...

随机推荐

  1. “全栈2019”Java异常第十一章:重写方法时只能抛出父类异常子集

    难度 初级 学习时间 10分钟 适合人群 零基础 开发语言 Java 开发环境 JDK v11 IntelliJ IDEA v2018.3 文章原文链接 "全栈2019"Java异 ...

  2. git log 与 git reflog 的 区别

    git log: commit 的版本日志 包含提交的版本 操作者 日期 (方便查看commit的版本,但是版本回退后,使用git log 看不到回退版本号之后的版本记录) commit ce0d69 ...

  3. AWS 推出长期支持的 OpenJDK 免费分发版本 —— Amazon Corretto

    简评:听说 Oracle JDK 要收费了,Oracle 要限制 Java 的商业或生产用途,针对这个问题,AWS 将会推出 Amazon Corretto. Java 是 AWS 用户使用的最流行的 ...

  4. java项目迁移

    电脑重装系统以后或者从不同MyEclipse版本迁移项目时候会出现: Project facet Java 1.5 is not supported by target runtime Apache ...

  5. 总结day24 ---- socket ,struct 的学习

    前情提要 一:套接字  socket()  1:三次握手 1:客户端像服务端链接,   (第一次握手) 2:服务端收到请求,告诉客户端服务端收到了内容    (第二次握手1) 3:服务端像客户端连接, ...

  6. luogu_1379 八数码难题

    八数码-->BFS+set #include<iostream> #include<cstdlib> #include<cstdio> #include< ...

  7. jedis 整合 Spring

    一,   单机版整合spring 1. 使用默认配置文件进行配置 <bean id="redisClient" class="redis.clients.jedis ...

  8. MySql互为主从配置文件及配置方法

    # Example MySQL config file for medium systems. # # This is for a system with little memory (32M - 6 ...

  9. C#中子类和父类

    在实例化子类的时候,总是先调用父类的无参构造函数

  10. spring boot快速入门 4: jpa数据库操作 实现增删改查

    spring boot jpa逆向生成表 简单实例: 第一步:pom文件: <?xml version="1.0" encoding="UTF-8"?&g ...