can any one help me by telling me what the hell is wrong with this?? i just want it to detect whether the broswer is netscape or IE and change the keypress handler as necessary and as that key is pressed close the window. damn javascript i hate it!
<script language=”JavaScript” type=”text/JavaScript”>
function keypress() {
if (navigator.appName == ‘Netscape’){
var e = “String.fromCharCode(e.which).toUpperCase()”;
}else{
var e = “String.fromCharCode(window.event.keyCode).toUpperCase()”;
}
switch (e) {
case T:
window.close();
break;
}
}
window.onKeyDown=keypress;
</script>
i know this is a bit of a mess but cheers if any one can help with this script. noaksey.