JS: How to check if a variable is NOT undefined
This question already has an answer here:
var lastname = "Hi";
if(typeof lastname !== "undefined")
{
alert("Hi. Variable is defined.");
}
链接地址: http://www.djcxy.com/p/95002.html
上一篇: Javascript数组的值是未定义的...我该如何测试
下一篇: JS:如何检查一个变量是不是未定义的