isNaN()是说参数是不是数值类型比如
function isNumber(a){
     var temp     temp = a.toString(10)
     if isNaN(temp){
       return true
     }else{
       retrun false 
     }    
}
如果a是个只含数字的字符串,结果是true

解决方案 »

  1.   

    你的函数中
    temp = a.toString(10)
    将传入的参数进行了转化,使其无论传入的是
    字符还是字母均转化为字符串temp
    将该句该为temp = a即可
    起始你这个函数时画蛇添足,本来isNan就能直接判断
    isNaN("2313213")=false;
    isNaN(2313213)=false;
    isNaN("2313213a")=true;
        
      

  2.   

    isNaN function
    On Unix platforms, evaluates an argument to determine if it is "NaN" (not a number). 语法
    isNaN(testValue)
    testValue is the value you want to evaluate. 描述
    The isNaN function is a built-in JavaScript function. It is not a method associated with any object, but is part of the language itself. isNaN is available on Unix platforms only. On all platforms except Windows, the parseFloat and parseInt functions return "NaN" when they evaluate a value that is not a number. The "NaN" value is not a number in any radix. You can call the isNaN function to determine if the result of parseFloat or parseInt is "NaN". If "NaN" is passed on to arithmetic operations, the operation results will also be "NaN". The isNaN function returns true or false. 例子
    The following example evaluates floatValue to determine if it is a number, then calls a procedure accordingly. floatValue=parseFloat(toFloat)if isNaN(floatValue) {
       notFloat()
    } else {
       isFloat()
    }
      

  3.   

    if (isNaN(document.judge.height.value))
    {
    alert("请正确填写身高");
    document.judge.height.focus();
    return ;
    }
    为什么不对呢?