lundi 2 février 2015

javascript variables not defined in IE11 but defined in chrome


There is a namepicker which is not functioning properly in ie11 but works fine in chrome. On inspection i found that the variables are undefined in IE11 but are defined in chrome. i used the alert function in the function to test the variable.


the very 1st time i loads the page the variables are defined .On a refresh variable becomes unset.This function is called by onload in html document



function fillInitialValues()
{

alert("Inside fillinitialvalues ");
alert("caller is " + arguments.callee.caller.toString());
if (typeof isSingle !== 'undefined') {
// the variable is defined
alert("Variable isSingle is defined"+isSingle);
}
else
{
alert("Variable isSingle is not defined");
}

if(!isSingle) {
alert("Inside fillinitialvalues checking in issingle");
targetNames = trimArray(baseTargetNames);
alert("base target names contain "+targetNames);
output = generateNamesHTML( targetNames, 'T' );
writeDiv( 'target', output );
}
self.focus();
document.getElementById('searchcriteria').focus();
}




Aucun commentaire:

Enregistrer un commentaire