1、为整数;
function IsInteger(Str)
{
Str=""+Str;
RegularExp=/^[-]?\d+$/;
if (RegularExp.test(Str))
{
return true;
}
else
{
return false;
}
}
2、为正整数
function IsInteger(Str)
{
Str=""+Str;
RegularExp=/^[0-9]+$/;
if (RegularExp.test(Str))
{
return true;
}
else
{
return false;
}
}