home *** CD-ROM | disk | FTP | other *** search
/ PC User 2005 May / CD / PCU0505CD.iso / software / full / coffecup / files / html2005.exe / %MAINDIR% / Javascript / RightClickPrevent.xml < prev    next >
Encoding:
Text File  |  2005-02-16  |  1.1 KB  |  44 lines

  1. <ccResource>
  2.   <ccTitle>
  3. Right Click Prevent
  4.   </ccTitle>
  5.   <ccCategory>
  6. Browser
  7.   </ccCategory>
  8.   <ccDescription>
  9. Use this script to help prevent users from stealing your content.  Only works in Internet Explorer 
  10.   </ccDescription>
  11.   <ccInstructions>
  12. The code goes only inside the BODY tags.  You can change the items below to suit your needs.
  13.   </ccInstructions>
  14.   <ccHeadContent>
  15.   
  16.   </ccHeadContent>
  17.   <ccBodyContent>
  18. <script language="JavaScript">
  19. function right(e) {
  20. if (navigator.appName == 'Netscape' && 
  21. (e.which == 3 || e.which == 2))
  22. return false;
  23. else if (navigator.appName == 'Microsoft Internet Explorer' && 
  24. (event.button == 2 || event.button == 3)) {
  25. alert("Please don't steal my stuff!!!");
  26. return false;
  27. }
  28. return true;
  29. }
  30. document.onmousedown=right;
  31. if (document.layers) window.captureEvents(Event.MOUSEDOWN);
  32. window.onmousedown=right;
  33. </script> 
  34.   </ccBodyContent>
  35.   <ccElementContent>
  36.   
  37.    <ccElementName></ccElementName>
  38.    <ccElementAction></ccElementAction>
  39.    
  40.   </ccElementContent>
  41.   <ccExtraData>
  42.  
  43.   </ccExtraData>
  44. </ccResource>