Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Closed Thread
How to disable right click in html
Old 05-05-2010, 06:49 AM How to disable right click in html
Average Talker

Posts: 28
Name: Cara.Micheal
Trades: 0
How to disable right click in HTML and easy way to do

Last edited by chrishirst; 05-05-2010 at 07:54 AM..
cara.micheal is offline
View Public Profile Visit cara.micheal's homepage!
 
 
Register now for full access!
Old 05-05-2010, 06:59 AM Re: How to disable right click in html
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
There is no way to have it on every browser in a way than an user cannot access it.
You'd better forget about it.

You want to avoid someone seeing your site source code, then don't put it on the web.
Or generate it as a big jpg image. (yurk...)
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
View Public Profile Visit tripy's homepage!
 
Old 05-05-2010, 07:10 AM Re: How to disable right click in html
Knight13's Avatar
Defies a Status

Posts: 10,289
Name: Knight13
Location: Cleveland, Ohio
Trades: 0
All that does is piss people off, i hate it when i go to a website and i can not right click to use the back button or the reload button, i agree with tripy just forget about it you will be better off.
Knight13 is offline
View Public Profile
 
Old 05-05-2010, 07:37 AM Re: How to disable right click in html
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
And JavaScript is easily disabled from most browsers anyway.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is offline
View Public Profile Visit wayfarer07's homepage!
 
Old 05-05-2010, 10:06 AM Re: How to disable right click in html
beta's Avatar
Extreme Talker

Posts: 169
Trades: 0
What is it that you want to do? I mean your goal might be solved in another way if you tell us what it is you want to accomplish by removing right clicking.
beta is offline
View Public Profile
 
Old 05-05-2010, 07:34 PM Re: How to disable right click in html
Marik's Avatar
Skilled Talker

Posts: 99
Trades: 0
Well putting this on your page will work:

HTML Code:
<SCRIPT LANGUAGE="JavaScript">
var message="Function Disabled!";
///////////////////////////////////
function clickIE() {if (document.all) {alert(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {alert(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
// --> 
</script>
But like others have said, there's no point. Javascript can be easily disabled.
Marik is offline
View Public Profile
 
Old 05-05-2010, 08:49 PM Re: How to disable right click in html
Skilled Talker

Posts: 93
Name: Ishie
Trades: 0
Disabling the right click option in a website could annoy users. I hate it actually. Make a site as user-friendly as possible. Avoid tricks and stuff like that.
__________________

Please login or register to view this content. Registration is FREE
ishie is offline
View Public Profile
 
Old 05-06-2010, 02:29 AM Re: How to disable right click in html
Skilled Talker

Posts: 60
Trades: 0
You could maybe disallow hot linking or using your bandwidth to serve up images to other sites if that is a concern. You can also add to .htaccess to prevent people from directly accessing folders or directories, and only allow them to go through your site. Disabling right clicking is not really worth it, and it is annoying. It used to be more popular than it is now, but I do see it once in a while. Screen captures / screen grabs come in handy for some sites.
__________________

Please login or register to view this content. Registration is FREE
gameutopia is offline
View Public Profile Visit gameutopia's homepage!
 
Old 05-06-2010, 03:02 AM Re: How to disable right click in html
rypher21's Avatar
Webmaster Talker

Posts: 564
Location: asia...but my heart is in australia :)
Trades: 0
in usability point of view, it aint nice havin a right click disabled...your user wont like it and instead of gettin more visitor, it could be one reason you'll lose them...
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

rypher21 is offline
View Public Profile Visit rypher21's homepage!
 
Old 05-06-2010, 03:56 AM Re: How to disable right click in html
Webmaster Talker

Posts: 687
Name: Rob Smith
Trades: 0
If you want disable right click you may want to disable link at all?
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
- Fully Managed Dedicated and since 1999.

Please login or register to view this content. Registration is FREE
- Low cost hosting from $2.79!
WebhostGIANT-Rob is offline
View Public Profile
 
Old 05-09-2010, 04:36 AM Re: How to disable right click in html
Junior Talker

Posts: 3
Trades: 0
I suggest not disabling it
bradoeoe is offline
View Public Profile
 
Old 05-09-2010, 09:13 AM Re: How to disable right click in html
Experienced Talker

Posts: 36
Name: Budhiman
Trades: 0
Firstly you can add a no right click code for images. Next adding a no right click javascript to protect your HTML and disabling copy and paste will also go a long way to help website security.

Use the script below so when someone right clicks to save an image off your page, a message will come up letting people know that your information is copyrighted.

Quote:
<script language="JavaScript">
<!-- var popup="Sorry, right-click
is disabled.\n\nThis Site Copyright ©2000"; function noway(go) { if
(document.all) { if (event.button == 2) { alert(popup); return false; } } if (document.layers)
{ if (go.which == 3) { alert(popup); return false; } } } if (document.layers)
{ document.captureEvents(Event.MOUSEDOWN); } document.onmousedown=noway; // -->
</script>
__________________
Buy Ads on Premium Blogs
PM Me or Visit
Please login or register to view this content. Registration is FREE
Ronni is offline
View Public Profile
 
Old 05-09-2010, 09:32 AM Re: How to disable right click in html
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
tools->options->content->javascript->advanced options-> uncheck "disable or replace context menus"
and your protection is gone.

You html source?
Even without changing anything, I hit ctrl+u and I see it.
You have firebug installed? Just hit F12 hit the HTML tab, and look at all that source code baby!

This is pointless, you cannot "protect" anything you put on the net.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
View Public Profile Visit tripy's homepage!
 
Old 05-10-2010, 05:00 AM Re: How to disable right click in html
Average Talker

Posts: 28
Name: Cara.Micheal
Trades: 0
Thanks for sharing all this information
cara.micheal is offline
View Public Profile Visit cara.micheal's homepage!
 
Old 05-12-2010, 06:56 AM Re: How to disable right click in html
Banned

Posts: 255
Name: Winson
Trades: 0
Hi Friend,

I think you should build your site in Flash if you don't want people viewing your source.


Thanks,
Winson
Winson is offline
View Public Profile
 
Old 05-12-2010, 10:56 AM Re: How to disable right click in html
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Sure.. "protect" your source and make it totally INACCESSIBLE in the process!! Bad idea. Just forget the idea of protecting your source, HTML is in no way proprietary.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
View Public Profile
 
Closed Thread     « Reply to How to disable right click in html
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.52750 seconds with 12 queries