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.
解决方案 »
- 有用过JVectorMap地图的吗?地图数据如何生成?
- 获取<p>标签内的文本
- 求解!!网站导航固定 内容可上下动的效果 怎么做的
- JScript 字符串和变量问题?水平右对齐?
- |zyciis| 如何找出当前标签后面的class='tag'的标签 谢谢
- JavaScript如何通过php(jsp。。。)连接数据库
- Javascript 有什么好的IDE 工具呢?
- 如何发送一个不需要返回结果的请求?
- 求一段广告代码.帮修改代码.
- 火狐里没有问题,但是在IE中,contentWindow就开始报错,大神们,帮帮忙= =。。。。。。。
- 高分求教:当关闭一个窗口时,自动打开新窗口
- 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>