Hey Gents,
Hopefully you can help out. To quickly explain. I've got a set of arrays in JavaScript that are declared (via PHP) on my page. However as there dynamic some will not be created. Essentially the test below should check if there is such an object, if it exists it skips the test, if not, theres an alert printed out. Now this works fine in Safari on Mac OS X, I have yet to try it on any PC but I'm assuming it probably works on NN and IE there. So the only problem is IE 5.2 on the Mac... It seems that if the variable(newOptions) is undeclared it doesn't event come up undefined in a typeof test. Does anyone know a workaround?
Take a look below please:
<script language="javascript">
function fillDropDown(){
if (typeof(eval(newOptions))=='undefined'){
} else {
alert('this is happening');
//Other Code to execute
}
}
</script>
Anyone got any ideas how to write a workaround for IE on the Mac? Or indeed is this something that doesn't work on a PC either?
Thanks guys!
whitenoiseie
Hopefully you can help out. To quickly explain. I've got a set of arrays in JavaScript that are declared (via PHP) on my page. However as there dynamic some will not be created. Essentially the test below should check if there is such an object, if it exists it skips the test, if not, theres an alert printed out. Now this works fine in Safari on Mac OS X, I have yet to try it on any PC but I'm assuming it probably works on NN and IE there. So the only problem is IE 5.2 on the Mac... It seems that if the variable(newOptions) is undeclared it doesn't event come up undefined in a typeof test. Does anyone know a workaround?
Take a look below please:
<script language="javascript">
function fillDropDown(){
if (typeof(eval(newOptions))=='undefined'){
} else {
alert('this is happening');
//Other Code to execute
}
}
</script>
Anyone got any ideas how to write a workaround for IE on the Mac? Or indeed is this something that doesn't work on a PC either?
Thanks guys!
whitenoiseie