assistmeandyou
05-24-2006, 08:26 PM
im at a lost here. tried what i could but nothing.
if this is simple could someone point me to what im doing wrong.
the following code works under windows explorer but not mozilla firefox.
yes its for school no they wont mind (they use explorer)
yes id preffer if it worked in both
<script language="JavaScript">
<!--
function mouseDown(e) {
var shiftPressed=0;
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
var mString =(e.modifiers+32).toString(2).substring(3,6);
shiftPressed=(mString.charAt(0)=="1");
self.status="modifiers="+e.modifiers+" ("+mString+")"
}
else {
shiftPressed=event.shiftKey;
self.status=""
+ "shiftKey="+event.shiftKey
}
if (shiftPressed)
alert ("Mouse clicked with the following keys:\n"
+ (shiftPressed ? "Shift ":"")
)
}
return true;
}
if (parseInt(navigator.appVersion)>3) {
document.onmousedown = mouseDown;
if (navigator.appName=="Netscape")
document.captureEvents(Event.MOUSEDOWN);
}
//-->
</script>
if this is simple could someone point me to what im doing wrong.
the following code works under windows explorer but not mozilla firefox.
yes its for school no they wont mind (they use explorer)
yes id preffer if it worked in both
<script language="JavaScript">
<!--
function mouseDown(e) {
var shiftPressed=0;
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
var mString =(e.modifiers+32).toString(2).substring(3,6);
shiftPressed=(mString.charAt(0)=="1");
self.status="modifiers="+e.modifiers+" ("+mString+")"
}
else {
shiftPressed=event.shiftKey;
self.status=""
+ "shiftKey="+event.shiftKey
}
if (shiftPressed)
alert ("Mouse clicked with the following keys:\n"
+ (shiftPressed ? "Shift ":"")
)
}
return true;
}
if (parseInt(navigator.appVersion)>3) {
document.onmousedown = mouseDown;
if (navigator.appName=="Netscape")
document.captureEvents(Event.MOUSEDOWN);
}
//-->
</script>