Click to See Complete Forum and Search --> : Why isn't this working...


dmason165
03-14-2003, 09:37 AM
Good morning to all!

I am trying to get the following script to work, but cannot. What is the problem?

<script language="javascript">
function noLeftClick() {
if (event.button == 1) {
alert('Your mouse buttons have been disabled for this page. Please use the menu that brought you this page to navigate.')
}
}
document.onmousedown=noLeftClick
</script>

Thanks in advance for your help and your time.

~Darron

dabush
03-14-2003, 10:13 AM
i think tis is the same wut u had... but this worked 4 me.

<script language=JavaScript type=text/javascript>
<!--
function noLeftClick()
{
if (event.button == 1) alert('Your mouse buttons have been disabled for this page. Please use the menu that brought you to this page to navigate.');
}
document.onmousedown=noLeftClick;
// -->
</script>

dmason165
03-14-2003, 10:16 AM
You got the alert to come up when you did it?

dabush
03-14-2003, 10:17 AM
yes. i came on a left mouse down.

dmason165
03-14-2003, 10:22 AM
When I click with the left mouse button, there is no alert...I don't know what's goin' on.

Ideas anyone?

~Darron

pyro
03-14-2003, 10:24 AM
What browsers have you tested in?

dmason165
03-14-2003, 10:26 AM
IE

~Darron

pyro
03-14-2003, 10:36 AM
What you originally posted works for me in IE6, and that is the only version of IE I have to test in...

dmason165
03-14-2003, 10:45 AM
Pyro & dabush,

Thank you for your help. If it works for you, then I guess it works. I'll just have to leave it the way it is.

Thanks again!

Cheers!

~Darron