elliottmina
Programmer
What is the best way to check if a variable is set? If it unset, then I can check its length, but I haven't been able to find any functions like empty(), isset(), etc.
TIA
TIA
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<script type="text/javascript">
if (isset("foo")) {
alert("yes foo");
}
else {
alert("no foo");
}
function isset(sVarName) {
return window[sVarName] != null;
}
</script>