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
JavaScript convert string variable in boolean using Regex
Generate random password for form field on click using JavaScript
jQuery simple form validations between start date and end date
How to scroll page to particular Div on click using jQuery?
JavaScript sort multi dimensional array on specific columns
Image Rollover Using onMouseOver and onMouseOut