Disable "View Source"

liunx

Guest
How can I add a code to my pages so that the viewer isn't able to right click and View Source for a web page? I read it somewhere but forget... Thankx<!--content-->You can disable right click with something like:<br />
<br />
<script language="javascript" type="text/javascript"><br />
document.oncontextmenu = IE; //IE<br />
if (!document.all) { //NN & Mozilla<br />
document.captureEvents(Event.MOUSEDOWN);document.onclick = NN;<br />
}<br />
<br />
function IE() { //IE<br />
if (document.all) {<br />
return false;<br />
}<br />
}<br />
<br />
function NN(e) { //NN & Mozilla<br />
if (e.which==2||e.which==3) {<br />
return false;<br />
}<br />
}<br />
<br />
But, that is not disabling View Source. There is no way to protect your source, as there are many easy ways for one to get it...<!--content-->Wow - that was a quick response. Thanks. I see a lot of my graphics around other sites in town. Someone likes to right click.<!--content-->A no-rightclick script is not going to stop people from taking your graphics. Here are a few other ways they could do it:<br />
<br />
File > Save As (to save the page -- including graphics)<br />
Get the page from their Temporary Internet Folder<br />
Use a screen capture program or the Windows Print Screen<br />
etc...<br />
<br />
Your best bet is going to be to add a watermark to your images, so people at least know where they came from...<!--content-->hmmm, wouldnt all your codes for ns be like exactly the same for mozilla? Since netscape and mozilla are almost carbon copyies<!--content-->oh nevermind, you were just putting those 2 separate because they will be recognised separatly instelad of just saying one or the other. What about opera being recognised as opera and not ie<!--content-->The script does not work for Opera browsers...Nor does any other no-rightclick script that I've seen.<!--content-->Okay - dummy here - how to add a watermark? I use Fireworks or Illustrator for most of my graphics...<!--content-->Just add a new layer, and add some semi-transparent text. Perhaps a link to your site. Usually on the lower-right corner. If you need to know how to do this in Fireworks, I can explain...<!--content-->Thanks for the tip...didn't realize you could do that - slow on the uptake here...<!--content-->The script does not work for Opera browsers...Nor does any other no-rightclick script that I've seen. <br />
<br />
I'd be curious to know if this is currently unavailable with Opera or if anyone has given it serious thought. I'll do some research and find out.<br />
<br />
Havik<!--content-->If you own the copyright on the images, and you are worried about intellectual property theft, then you might want to look into digital watermarking. This basically consists of embedding a small, invisible 'tracking bug' into each of your images. A bot, similiar to a search engine spider, will then scour the web and report back on anywhere that it finds your images. This will allow you to warn people off or file court action. Of course, just disabling right click, watermarking and displaying copyright notes will warn most off.<br />
BTW, most property protection companies recommend puttting watermarks through the center, and large. This is to stop them being removed very easily.<!--content-->Okay - so I add a watermark to my graphics...silly question, but then the watermark would show up on the web pages I put them on, wouldn't they? Also, how do I add a copyright note to the graphic?<br />
<br />
dumb de dumb dumb...<!--content-->Yes, your watermark will show up on your graphics. To add a copyright notice, I would just add something like &copy; 2003 <!-- m --><a class="postlink" href="http://www.yourdomain.com">http://www.yourdomain.com</a><!-- m --><!--content-->I believe you are also obliged to add the name of the copyright holder.<!--content-->Thank you to all that have helped me with this. I really appreciate it. Carry on...<!--content-->
 
Back
Top