var Validator = { // 邮箱 isEmail : function(s) { var p = "^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$"; return this.test(s, p); }, // 手机号码 isMobile : function(s) { return this.test(s, /^(180|189|133|134|153|181)\d{8}$/); }, // 电话号码 isPhone : function(s) { return this.test(s, /^[0-9]{3,4}\-[0-9]{7,8}$/); }, // 邮编 isPostCode : function(s) { return this.test(s, /^[1-9][0-9]{5}$/); }, // 数字 isNumber : function(s, d) { return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$')); }, // 判断是否为空 isEmpty : function(s) { return !jQuery.isEmptyObject(s); }, // 正则匹配 test : function(s, p) { s = s.nodeType == 1 ? s.value : s; return new RegExp(p).test(s); } };
點(diǎn)擊查看更多內(nèi)容
為 TA 點(diǎn)贊
評論
評論
共同學(xué)習(xí),寫下你的評論
評論加載中...
作者其他優(yōu)質(zhì)文章
正在加載中
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦