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

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://www.cnblogs.com/freefei/p/3234979.html