I am using javascript function where i need to check undefined value in if condition.
var a = getParameterByName('a');
// if condition comes true only then below line should be executed.
// but everytime either condition is true or false, below statement is executed.
if (typeof (a) !== "undefined") {
document.getElementById("img1").src = getParameterByName('a');
}
if (typeof getParameterByName('d') !== "undefined") {
document.getElementById("video").src = getParameterByName('d');
}
is there any problem in using 'undefined' ?? please help me as soon as posssible. Thanks