/    Sign up×
Community /Pin to ProfileBookmark

Why isn’t this working…

Good morning to all!

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

[COLOR=chocolate][B]<script language=[/B][/COLOR]“javascript”[COLOR=chocolate][B]>[/B][/COLOR]
[B]function[/B] noLeftClick[COLOR=darkblue][B]() {[/B][/COLOR]
[COLOR=darkblue][B]if ([/B][/COLOR][COLOR=purple]event[/COLOR].button [COLOR=blue]==[/COLOR] [COLOR=red]1[/COLOR][COLOR=darkblue][B]) {[/B][/COLOR]
[COLOR=purple]alert[/COLOR][COLOR=darkblue][B]([/B][/COLOR]‘Your mouse buttons have been disabled for this page. Please use the menu that brought you this page to navigate.’[COLOR=darkblue][B])[/B][/COLOR]
[COLOR=darkblue][B]}[/B][/COLOR]
[COLOR=darkblue][B]}[/B][/COLOR]
[COLOR=purple]document[/COLOR].onmousedown[COLOR=blue]=[/COLOR]noLeftClick
[COLOR=chocolate][B]</script>[/B][/COLOR]

Thanks in advance for your help and your time.

~Darron

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@dabushMar 14.2003 — i think tis is the same wut u had... but this worked 4 me.

&lt;script language=JavaScript type=text/javascript&gt;
&lt;!--
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;
// --&gt;
&lt;/script&gt;
Copy linkTweet thisAlerts:
@dmason165authorMar 14.2003 — You got the alert to come up when you did it?
Copy linkTweet thisAlerts:
@dabushMar 14.2003 — yes. i came on a left mouse down.
Copy linkTweet thisAlerts:
@dmason165authorMar 14.2003 — When I click with the left mouse button, there is no alert...I don't know what's goin' on.

Ideas anyone?

~Darron
Copy linkTweet thisAlerts:
@pyroMar 14.2003 — What browsers have you tested in?
Copy linkTweet thisAlerts:
@dmason165authorMar 14.2003 — IE

~Darron
Copy linkTweet thisAlerts:
@pyroMar 14.2003 — What you originally posted works for me in IE6, and that is the only version of IE I have to test in...
Copy linkTweet thisAlerts:
@dmason165authorMar 14.2003 — 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
×

Success!

Help @dmason165 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...