<html>
<head>
<script type="text/javascript">
function wwww(a)
{   var sss=a.toString();
                  
alert(sss);
}
</script>
</head>
<body>
<form name="fm">
<input type="hidden" name="test" value="20590235010108004846"/>
<input type="button" value="test" onclick="wwww(20590235010108004846)"/>
</form>
</body>
</html>上面程序alert的值已经不是原数字了,求大神指点

解决方案 »

  1.   

    <html>
    <head>
    <script type="text/javascript">
    function wwww(a)

        
    alert(a);
    }
    </script>
    </head>
    <body>
    <form name="fm">
    <input type="hidden" name="test" value="20590235010108004846"/>
    <input type="button" value="test" onclick="wwww('20590235010108004846')"/>
    </form>
    </body>
    </html>去掉toString();直接传字符串
      

  2.   

    64bit数字?
    参考:http://stackoverflow.com/questions/2983206/bitwise-and-in-javascript-with-a-64-bit-integer
      

  3.   

    <html>
    <head>
    <script type="text/javascript">
    function wwww(a)

     //方法一  
    //alert("类型为:"+typeof (a-0)+" 值为:"+(a-0)); //将一个字符串进行数学运算,会自行转换为number类型
    //方法二
    alert("类型为:"+typeof parseInt(a)+" 值为:"+parseInt(a));//window自带方法,将string类型转为number类型;}
    </script>
    </head>
    <body>
    <form name="fm">
    <input type="hidden" name="test" value="20590235010108004846"/>
    <input type="button" value="test" onclick="wwww('20590235010108004846')"/>
    </form>
    </body>
    </html>