昨天一顿问,整理出这个函数,已经可以使用了,大伙看看还有漏洞没?function IsInt(str as string)
if str isnot nothing then
return Regex.IsMatch( str, "^[1-9]\d*$" )
else
return false
end if
end function
if str isnot nothing then
return Regex.IsMatch( str, "^[1-9]\d*$" )
else
return false
end if
end function
alert("必須為数字");
return false;}試過OK
{
if(!isNaN(num))
{
alert(num + " is a number");
}
else
alert(num + " is not a number");
}