In php to determine if a certain variable is set we use the function,
isset($variable)
it returns a boolean value.
To do the same thing in javascript, use the following condition,
if(typeof variable != ‘undefined’){
alert(’This variable is not defined yet’);
}
else {
alert(’The variable is defined’);
}
