Fork me on GitHub
代码改变世界

typeof(fatime)方法 检查变量类型 bool number string null 等

2013-01-07 15:47  freefei  阅读(237)  评论(0编辑  收藏  举报
ypeof 运算符返回一个用来表示表达式的数据类型的字符串。 可能的字符串有:"number"、"string"、"boolean"、"object"、"function" 和 "undefined"。 如: alert(typeof (123));//typeof(123)返回"number" alert(typeof ("123"));//typeof("123")返回"string" [js] if(typeof(fatime)=="undefined" || typeof(fatime)=="NULL" || typeof(fatime)=="" ){ }else if(typeof(fatime)=="number"){ if(nowtime<=fatime){ //alert("请不要频繁恶意刷屏"); $("#textleng").html("请不要频繁恶意刷屏"); //alert(fatime); return false; }else{ $("#textleng").html(""); } } [/js]
@ https://github.com/ranmufei

守望者舆情监控

守望者舆情监控系统