How to check 'undefined' value in jQuery

后端 未结 11 590
慢半拍i
慢半拍i 2020-12-12 11:49

Possible Duplicate:
Detecting an undefined object property in JavaScript
javascript undefined compare

H

11条回答
  •  天涯浪人
    2020-12-12 12:06

    You can use shorthand technique to check whether it is undefined or null

     function A(val)
     {
       if(val || "") 
       //do this
     else
     //do this
     }
    

    hope this will help you

提交回复
热议问题