雨笑烟燃

专注于VB.net.关注WPF.

« 模拟.Net的JS代码Js中模拟.Net功能(二) »

验证手机号码所属运营商的JS代码

function getMobileServices(mobile) {
if(mobile.startwith("0")==true){
mobile=mobile.substring(1);
}
if(mobile.startwith("+086")==true){
mobile=mobile.substring(4);
}
var chinaunicom=new Array("130","131","132","133");
var chinamobilea=new Array("135","136","137","138","139","150","158","159");
var chinamobileb=new Array("1340","1341","1342","1343","1344","1345","1346","1347","1348");
var bolchinaunicom=chinaunicom.contains(mobile.substring(0,3));
var bolchinamobilea=chinamobilea.contains(mobile.substring(0,3));
var bochinamobileb=chinamobileb.contains(mobile.substring(0,4));
if(bolchinaunicom)
return 1//联通
if(bolchinamobilea || bochinamobileb )
return 2 //移动
return 3 //电信或其他营运商
}

  • 相关文章:

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

最新评论及回复

最近发表

Powered By Z-Blog 1.8 Walle Build 100427

Copyright yxyr.com ,Some Rights Reserved.浙ICP备06021833号