I found the script here for disabling right clicks on images and it work wonderfully, but wanted to know if there was one (or if the current script could be modified) to block PDFs from being copied as well. My coding skills are a little rough since I haven't been "in practice" in years and I'm not even sure if that type of PDF control is within the power of scripting.
This is the script I have for reference sake...
Code:<script language="JavaScript1.2"> /* Disable right click script II (on images)- By Dynamicdrive.com For full source, Terms of service, and 100s DTHML scripts Visit http://www.dynamicdrive.com */ var clickmessage="Right click disabled on images" function disableclick(e) { if (document.all) { if (event.button==2||event.button==3) { if (event.srcElement.tagName=="IMG"){ alert(clickmessage); return false; } } } else if (document.layers) { if (e.which == 3) { alert(clickmessage); return false; } } else if (document.getElementById){ if (e.which==3&&e.target.tagName=="IMG"){ alert(clickmessage) return false } } } function associateimages(){ for(i=0;i<document.images.length;i++) document.images[i].onmousedown=disableclick; } if (document.all) document.onmousedown=disableclick else if (document.getElementById) document.onmouseup=disableclick else if (document.layers) associateimages() </script>



Reply With Quote

) by saying that the internet is made for sharing. If you don't want to share something with the world, don't put it on your site!
Bookmarks