js方法调用方法,怎么玩

[复制链接]
查看11 | 回复1 | 2021-1-27 06:46:05 | 显示全部楼层 |阅读模式
!this.is_number(num)
functionTest(){
this.num=function(b){
if(!this.is_number(num)){
alert('验证失败');
returnfalse;
}};


this.is_number=function(n){
re=/^\d{5,15}$/;
varc=false;
if(re.test(n)){c=true;}
return(c);
}
}
分 -->
回复

使用道具 举报

千问 | 2021-1-27 06:46:05 | 显示全部楼层

Test(15088888888);
functionTest(str){
this.num=function(b){
if(!this.is_number(b)){
alert('验证失败');
returnfalse;
}else{
alert('验证成功');
returnfalse;
}
};
this.is_number=function(n){
re=/^\d{5,15}$/;
varc=false;
if(re.test(n)){c=true;}
return(c);
}
num(str);
}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行