use isNaN()var s;
.....
if (typeof(s) == "string")
{
if (s.length != 0 && !isNaN(s))
alert("it is a number");
else
alert("it is just a string");
}
.....
if (typeof(s) == "string")
{
if (s.length != 0 && !isNaN(s))
alert("it is a number");
else
alert("it is just a string");
}
解决方案 »
- 请教大牛!js倒计时精确到毫秒
- ExtJs 2.3 store的问题
- 怎样不通过<a href>标签来实现点击后页面跳转?
- Web服务器与ActiveX控件的通信方式
- 高手请进,说难也不难,说容易也不容易
- 求一个正则表达式的写法
- 急!如何用脚本设置浏览器的安全级别?急!
- 在javascript里用这样var today=new day()得到的时间,可不可以用mon=today.getMonth()来得到月份,以及其它的年、日等?如果可以,为什
- 用window.open()方法打开一个新的窗口,我可以传进自己的变量么?
- 如何截取字符串 www.qdjhu.com 中的 qdjhu ?
- 请问我希望在javascript过程中判断变量是否为date变量怎么判断,求救
- 怎样取得用户登陆局域网的用户名
我又学到了一些东西
我以前都用
window.execScript("isn = isNumeric(variables)","vbscript")