"Fabian" <la****@hotmail.com> wrote in message
news:bv************@ID-174912.news.uni-berlin.de...
How can I check whether or not a variable exists in a script? I'm
thinking in terms of
if (my variable exists) { myfunction(); }
if(typeof x != 'undefined'){
...
}
Is as near as you can get. But a variable that is declared but has not
yet been assigned a value will also return 'undefined' from a typeof
test. A declared variable could be said to "exist" but in reality this
is probably suitable to your problem.
Richard.