mitya
12-12-2003, 05:37 AM
Silly me, thinking I could expect JS to be syntactically identical to PHP. How do I check if a var is null or hasn't been set?? In PHP this would simply be:
if (!$var) { or if (!isset($var)) {
But if I do either of them in JS, or even if (var = null), it moans that the var is undefined. Which, er, is what I'm wanting to check.
Silly JS! (thanks in advance)
if (!$var) { or if (!isset($var)) {
But if I do either of them in JS, or even if (var = null), it moans that the var is undefined. Which, er, is what I'm wanting to check.
Silly JS! (thanks in advance)