The only way to truly test if a variable is undefined is to do the following. Remember, undefined is an object in JavaScript.
<!DOCTYPE html>
<html>
<body>
<script>
if (typeof someVar === 'undefined') {
alert("Your variable is undefined");
}
</script>
</body>
</html>
Most Helpful This Week
jQuery move multi select values from one to another multi select list
How can I redirect the user from one page to another using jQuery or pure JavaScript?
How to get selected text from a select box using jQuery?
Using jQuery add new table row on click
Edit the text of label on click using jQuery
jQuery check if an element is visible or hidden