湖南鸟巢专利孵化 2011-11-01
扩展jquery.validate
/*
* 中国移动号段大全:
2G手机号段大全:134、135、136、137、138、139、150、151、152、157、158、159;
3G手机号段大全:182、187、188;
中国联通号段大全:
2G手机号段大全:130、131、132、155、156;
3G手机号段大全:185、186;
中国电信号段大全:
2G手机号段大全:133、153;
3G手机号段大全:180、189
* 2011-10-31
* author LiuDong
* */
$.validator.addMethod('isMobile', function(value, element) {
var length = value.length;
return this.optional(element) || length == 11 &&
/^13[0-9]{1}[0-9]{8}$|^15[012356789]{1}[0-9]{8}$|^18[0256789]{1}[0-9]{8}$/.test(value);
}, '请输入有效的手机号码');使用示例
$(function() {
$('#frmCustomerInfo').validate({
rules: {
'customer.contactTel': {
digits: true,
isMobile:"#customer.contactTel"
//range:
}
},
messages: {
'tel': '请输入目前有效手机号(数字且为11位!)'
}
});
});JS正则表达式大全
http://www.blogjava.net/onejavaer/articles/79070.html
大家好,先说明下,我是个android业余开发人员。最近结合微信还有移动云存储做了个小应用。一切都基本OK了,最后发现一种情况,对于中国移动3G手机,在使用3g网时,无法请求到云存储stackmob。