Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

disabling right click?


ravenmedia

Recommended Posts

do i have to put this script on every single page in order for it to disable right click?

 

<script type="text/javascript">

<!--

 

var ie4 = document.all;

var ns4 = document.layers;

 

if (ns4) document.captureEvents(Event.MOUSEDOWN);

 

document.onmousedown = right;

 

function right(e) {

 

var msg = "Sorry, right-click has been disabled.";

 

if (ns4 && e.which == 3) {

  alert(msg);

  return false;

 

  } else if (ie4 && event.button==2) {

  alert(msg);

  return false;

}

 

return true;

}

 

 

function trap() {

 

if (navigator.appName == 'Netscape' && document.images) {

  for (i=0; i<document.images.length; i++)

  document.images.onMOUSEDOWN = right;

}

}

 

// --></script>

Link to comment
Share on other sites

IF you think that disabling right click will stop anyone from taking images or anything of that nature keep on thing in mind. You can always just press the " print screen " key and just get the image that way. Or you can just press the right click key on any windows keyboard that has that key. ( this used to work ) and it's really annoying to people that actually use right click to get to the last page or anything of that nature ...

Link to comment
Share on other sites

Also you can just drag the image to your url bar and it will open the image on a new

page without the blocking script.

 

However if you are driven to put the script in you could always use a batch find and

replacer. Do a google search.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...