Detecting Undefined Variables in JavaScript
This pops up every so often so I thought I’d dedicate a post to it. JavaScript has no “isset” function. Instead, your best bet is to use the following:
if((typeof theVariable) == ‘undefined’)
This pops up every so often so I thought I’d dedicate a post to it. JavaScript has no “isset” function. Instead, your best bet is to use the following:
if((typeof theVariable) == ‘undefined’)
TrackBack URI |
Blog RSS
|
Comment RSS
No comments yet.