Welcome Guest ( Log In | Register )



2 Pages V   1 2 >  
Reply to this topicStart new topic
> Javascript: Disable Mouse Right-click In Browser
wannabeeaweak
post Sep 25 2004, 05:43 AM
Post #1


Member [ Level 2 ]
Group Icon

Group: Members
Posts: 71
Joined: 24-September 04
From: Los Angeles, CA
Member No.: 830



just copy and paste this on to your html site in the head tag

CODE

<script language="JavaScript">
<!--
/*
*/

var message="Hey YOU!\nStop Stealing my pictures or\nFACE THE PUNISHMENT!"



function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// -->

</script>


This post has been edited by microscopic^earthling: Apr 19 2005, 03:36 PM
Go to the top of the page
 
+Quote Post
k22
post Sep 25 2004, 01:10 PM
Post #2


Advanced Member
Group Icon

Group: Members
Posts: 165
Joined: 22-September 04
From: IS - IT - US - BE
Member No.: 804



But if you want to use it anyway just use firefox(no the 1PR version) and add this plugin biggrin.gif
https://update.mozilla.org/extensions/morei...p?id=89&vid=101
Go to the top of the page
 
+Quote Post
overture
post Sep 25 2004, 03:06 PM
Post #3


Premium Member
Group Icon

Group: Members
Posts: 208
Joined: 6-September 04
From: England
Member No.: 315



or just add this to your body tag:
CODE
oncontextmenu="return false"

that will stop right-click in IE. It won't return a message but it does stop this. I have given this out before in another topic along with a couple more pieces for all those who still want to use it(i see no reason to). I have also stated that it will not work in Firefox(any version), it only works in IE.
Go to the top of the page
 
+Quote Post
qwijibow
post Sep 26 2004, 12:08 AM
Post #4


Way Out Of Control - You need a life :)
Group Icon

Group: Members
Posts: 1,366
Joined: 14-September 04
From: Nottingham England
Member No.: 570



this doesnt work in most browsers.. and even if it did, it doesnt stop people from clicking "View source" and EEEVEN if it did that, then it wouldnt stop people getting the source with telnet.

this code is useless, sorry, and its been poted many times already by other people.
Go to the top of the page
 
+Quote Post
UberVamp44
post Sep 26 2004, 05:51 AM
Post #5


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 12
Joined: 25-September 04
Member No.: 863



For HTMl i was told that this would work also }no right click{ well some thing like that
Go to the top of the page
 
+Quote Post
dcy
post Sep 26 2004, 06:36 AM
Post #6


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 12
Joined: 16-September 04
Member No.: 615



i dont know if it is important to stop your right-click in IE, as for me i dont use it,
everytime when i want to copy or paste somethings , use right-click is very good,
but use right-click it will block somethings,just like when someone want to view your site's source code, so i dont use right-click!
Go to the top of the page
 
+Quote Post
wannabeeaweak
post Sep 28 2004, 03:48 AM
Post #7


Member [ Level 2 ]
Group Icon

Group: Members
Posts: 71
Joined: 24-September 04
From: Los Angeles, CA
Member No.: 830



yes all this stuff is true but this script help for people to not get your source code cause u don't want people to have the same stuff on there site as u do
Go to the top of the page
 
+Quote Post
overture
post Sep 28 2004, 01:24 PM
Post #8


Premium Member
Group Icon

Group: Members
Posts: 208
Joined: 6-September 04
From: England
Member No.: 315



but it will not stop people (most of them anyway) there are ways around it like using a different browser, or you could just save the page and view the html from the saved pages (right-click the document and click open with Notepad, or something like that). Sorry to say that.
Go to the top of the page
 
+Quote Post
bx93
post Oct 3 2004, 12:51 AM
Post #9


Member [ Level 2 ]
Group Icon

Group: Members
Posts: 68
Joined: 11-September 04
From: Hangzhou, China
Member No.: 488



This is important for someone to keep safe their product which they use to get money. See the following link: http://www.entheosweb.com/website_template...ew/learning.asp

However, I don't know how to achieve this, as I could not open the link in a new window, and don't know how to save the html.
Go to the top of the page
 
+Quote Post
bbdesign
post Nov 4 2004, 01:25 AM
Post #10


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 13
Joined: 4-November 04
Member No.: 1,305



sure.... that works, unless the person disables javascript
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Getting Screen Resolution using Javascript.(8)
  2. How To Create A Popup Window With Javascript?(19)
  3. javascript vs java(12)
  4. Best Way To Learn Javascript(9)
  5. Javascript: Text To Texbox And Back To Text(2)
  6. Dynamically Change The Background Image On Mouse Effects!(3)
  7. Change Table Colors On Mouse Effects!(8)
  8. Browser Quaker Script - Shock Your Visitors!(5)
  9. Javascript: Simple Slidedown Menu(2)
  10. JavaScript: Hide And Show Any Element With CSS(5)
  11. Ever Needs To Find Out A Table Height Or With With JavaScript(2)
  12. Create And Import JavaScript Modules For A Large Script(2)
  13. Vertical Marquee Using JavaScript(0)
  14. JavaScript Frames & Querystring(4)
  15. JavaScript Off Redirect Script(2)
  1. I Need Help With Javascript.(7)
  2. Problems With Dynamically Loading Javascript(2)
  3. One Click To Copy Script(0)
  4. Add Text To Textarea(6)
  5. Javascript Question(4)
  6. Javascript: How Do I Create Embedded Pop-up Windows?(7)
  7. Get Mouse Position(4)
  8. Problem With Javascript Alert();(9)
  9. Include Function For Javascript(7)
  10. Fun With Javascript And Forms(2)
  11. When A User Close The Browser Window(1)
  12. Javascript Help Needed : Alert(z) Works Fine But Document.write Not(2)
  13. Javascript Changes Aren't Working.(6)


 



- Lo-Fi Version Time is now: 21st August 2008 - 09:51 PM