DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> 關於JavaScript >> js用typeof方法教程判斷undefined類型
js用typeof方法教程判斷undefined類型
編輯:關於JavaScript     

js判斷undefined類型

if (reValue== undefined)
{
alert("undefined");
}

發現判斷不出來,最後查了下資料要用typeof方法:

if (typeof(reValue) == "undefined") 
{ 
alert("undefined"); 
}

 typeof 返回的是字符串,有六種可能:"number"、"string"、"boolean"、"object"、"function"、"undefined"

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved