星期一, 7月 09, 2012

[JavaScript] 驗證物件為null或undefined

如果檢查物件是否為null或undefined
if(typeof(foo) !== 'undefined' && foo != null) {
    //you can use foo!
}

沒有留言:

張貼留言

留個話吧:)

其他你感興趣的文章

Related Posts with Thumbnails