navwin » Tech Talk » How Do You Spell HTML? » Java script
How Do You Spell HTML?
Post A Reply Post New Topic Java script Go to Previous / Newer Topic Back to Topic List Go to Next / Older Topic
WhtDove
Member Rara Avis
since 1999-07-22
Posts 9245
Illinois

0 posted 2001-04-14 10:40 AM


Does someone know the code for no right click?

please  

© Copyright 2001 WhtDove - All Rights Reserved
Christopher
Moderator
Member Rara Avis
since 1999-08-02
Posts 8296
Purgatorial Incarceration
1 posted 2001-04-15 06:01 AM


Depending on what you want it for Becca - here it is. Remember that it has limited use - a) people without scripting ability, or with scripting turned off will bypass this, and anyone can gain access to your page info by viewing sorce through their top menu.  

I skipped ahead in my reading to put this together, and it works.. but there may definitely be better ways to do it... not as sloppy you know!   If there is, I'd like to know!

Peace,

C

Insert the following into the head of your document and modify the phrase o fit what you want...

<script language="JavaScript">
<!--Begins script function parameters
function nope(e) {
//are they using Netscape?
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
//if yes, then don't tell em anything, just block it!
return false
//if not NEtscape, then IE?
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
//if yes, then tell em whatcha think!
alert("Not a chance Buster!")
return false }
return true }
//end function paramaters
//invoke function
document.onmousedown=nope
document.onmouseup=nope
if (document.layers) window.captureEvents(Event.MOUSEDOWN)
if (document.layers) window.captureEvents(Event.MOUSEUP)
window.onmousedown=nope
window.onmouseup=nope
//end da script-->
</script>

WhtDove
Member Rara Avis
since 1999-07-22
Posts 9245
Illinois
2 posted 2001-04-15 10:22 AM


Chris I have to put all this up like you have it here????

It's not the source I'm worried about. It's some of the graphics. I know they can still get them from other ways, but it will stop those who are too lazy to do it.  

Here's what I found on a site, but not sure if this was all of it or not.

<!-- // no rightclick script v.2.5

var message="happy surfing" // Message for the alert box
var message2="blah blah"// Don't edit below!
function click(e){
if (document.all){
if (event.button==2){
alert (message);
alert (message2);
return false;
}
}
if (document.layers){
if (e.which ==3){
alert (message);
alert (message2);
return false;
}
}
}
if (document.layers){
document.onmouse down=click;
// -->
</script>


geez...if things work out, I guess I'll learn this stuff in the fall, but that seems like a lot of junk, just to say no, ya know? LOL

Thanks Chris.....

Ron
Administrator
Member Rara Avis
since 1999-05-19
Posts 8669
Michigan, US
3 posted 2001-04-15 12:02 PM


You might want to reconsider, Becky.

There are some things on the Internet that people feel very strongly about, like Spam or opening a zillion popup windows. This is one of them. Right-click is used for a LOT of things besides saving images. When you disable something on my computer, for whatever justification, you are overstepping your boundaries. Kinda like inviting someone into your home, and then handcuffing their hands behind their back.

If you don't want people saving graphics, don't put them on your web site. If you do put them on your web site, assume people are going to smart enough to turn off JavaScript to get them. Because disabling the right-click irritates the good guys without even slowing down the bad ones.

IMHO  

WhtDove
Member Rara Avis
since 1999-07-22
Posts 9245
Illinois
4 posted 2001-04-15 08:16 PM


Point well taken Ron. Thanks, guess I'll just leave it as is.  
Post A Reply Post New Topic ⇧ top of page ⇧ Go to Previous / Newer Topic Back to Topic List Go to Next / Older Topic
All times are ET (US). All dates are in Year-Month-Day format.
navwin » Tech Talk » How Do You Spell HTML? » Java script

Passions in Poetry | pipTalk Home Page | Main Poetry Forums | 100 Best Poems

How to Join | Member's Area / Help | Private Library | Search | Contact Us | Login
Discussion | Tech Talk | Archives | Sanctuary