D
Daniel
Hullo =)
Inspired by another guy's questions here I've created an isset function that
works (almost) like the one in native PHP:
function isset(variablename) {
return(typeof(eval("window."+variablename))!='undefined');
}
I use it like if(isset('myVar') { alert(myVar); }
My question is if variables are always accessible like this, as properties
of the window object, in all browsers. I would hate it if it turned out not
to work in Opera or an older Mozilla or something like that.
Thanks,
Daniel =)
Inspired by another guy's questions here I've created an isset function that
works (almost) like the one in native PHP:
function isset(variablename) {
return(typeof(eval("window."+variablename))!='undefined');
}
I use it like if(isset('myVar') { alert(myVar); }
My question is if variables are always accessible like this, as properties
of the window object, in all browsers. I would hate it if it turned out not
to work in Opera or an older Mozilla or something like that.
Thanks,
Daniel =)