function checkIsNum(str) { //如果为空,则通过校验 if(str == "") return true; if(/^(/-?)(/d+)$/.test(str)) return true; else return false; }