顯示具有 Jquery 標籤的文章。 顯示所有文章
顯示具有 Jquery 標籤的文章。 顯示所有文章

2016年11月22日 星期二

JavaScript/Jquery簡單判斷undefined


var test = undefined;

if (typeof(test) == "undefined")
{
    alert("undefined");
}
typeof 返回有六種可能:"number"、"string"、"boolean"、"object"、"function"、"undefined"