isNaN Method
Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). isNaN(numValue) The required numValue is the value to be tested against NAN.Res
The isNaN function returns true if the value is NaN, and false otherwise. You typically use this function to test return values from the parseInt and parseFloat methods. Alternatively, a variable could be compared to itself. If it compares as unequal, it is NaN. This is because NaN is the only value that is not equal to itself.
Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). isNaN(numValue) The required numValue is the value to be tested against NAN.Res
The isNaN function returns true if the value is NaN, and false otherwise. You typically use this function to test return values from the parseInt and parseFloat methods. Alternatively, a variable could be compared to itself. If it compares as unequal, it is NaN. This is because NaN is the only value that is not equal to itself.
解决方案 »
- typeof的问题。。。
- 请问这个网页里的js代码能下载吗?
- 怎么在一堆li之间获取自己想要的li。。
- 请教window.print()的问题(怎样去掉页面下面的URL)
- 请问:如何把select表单的内容复制到另一个select表单里~~~ ^_^
- 根据表单单选框的不同选择提交到不同页面的问题
- 如何在javascript里面将打印的方式设置成横向?急!!!谢了啊!!!!
- 为什么不能检测username的长度?
- 对某个页面刷新与链接到这个文件有什么区别
- 大家帮帮忙,json字符串转换成json对象的key值顺序问题
- 高分求教:当关闭一个窗口时,自动打开新窗口
- http://expert.csdn.net/Expert/topic/1929/1929725.xml?temp=.5074427
<!--
var strValue="1";
iTest=strValue*0;
if(iTest!=0)
alert("字符型");
else
alert("数值型");
-->
</Script>
r = 53
k = IsNumeric(r) ' 返回 True。ar = "459.95"
ck = IsNumeric(ar) ' 返回True。
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>
<form name=myform><input type=text name=text>
<input value=check type=button onclick=chk()></form>
<script language=javascript>
function chk()
{
if (isNaN(document.myform.text.value)==false) alert("数字")
else alert("非数字")
}
</script>
</BODY>
</HTML>