I\'m looking for the javascript equivalent of the php function isset(). I\'ve tried the method described here at JavaScript isset() equivalent but at firebug, e
isset()
isset() makes two checks: first if the variable is defined, and second if it is null.
You will have to check for both the 'undefined' case and the null case, for example:
if (typeof data !== 'undefined' && data !== null)