post your comment   print   send to a friend
Rate:  61% | Views: 2568
Question categories:  JavaScript

How can I keep pictures on my website from being saved by visitors?

Answer by: Kristen Jourdonais, Aplus.Net Knowledge Base Support.

It is difficult to implement a fool-proof method of keeping your website visitors from saving and possibly redistributing images on your website. However, there are certain methods that can prevent most users from saving your unique or copyrighted images from your web page. The most popular method includes using JavaScript.

The script that follows denies a user from using the “right-click” functionality of their mouse that is typically used to save an image from a web page. To install the “No Right-Click” script on your page, paste this code into the HEAD of your HTML document:

<HEAD>

<SCRIPT LANGUAGE="JavaScript1.1">

<!-- Begin

function right(e) {

if (navigator.appName == 'Netscape' &&

(e.which == 3 || e.which == 2))

return false;

else if (navigator.appName == 'Microsoft Internet Explorer' &&

(event.button == 2 || event.button == 3)) {

alert("Sorry, you do not have permission to right click.");

return false;

}

return true;

}

document.onmousedown=right;

document.onmouseup=right;

if (document.layers) window.captureEvents(Event.MOUSEDOWN);

if (document.layers) window.captureEvents(Event.MOUSEUP);

window.onmousedown=right;

window.onmouseup=right;

// End -->

</script>

</HEAD>

Customer Feedback
Rate:  61% | Views: 2568 | Please Rate:  
 
If you have other comments or ideas for future technical tips, please type them here:

Email: (optional)

Comments: (optional)

 Website Hosting | Web Site Design    Back to serch results
Browse the Base
Knowledge Base
Web Design
  Do It Yourself
    JavaScript
Messages
 

Please update your contact information

Dear customers: We regularly e-mail you with important details regarding your website, such as billing issues, problems with your website, scheduled maintenance, etc.. It is important that your contact information is up to date. Please make sure that your contact information is accurate in our records, so that you can receive all necessary correspondence. Thank you from Aplus.Net! Go to "My account" --> "My info" --> "e-mail" in this Control Panel to update.

Private Area
 
Ask
in Private
   
Personal
Folder
 
Related Questions
 
1. Calculating days remaining until Christmas
 
2. Detecting browser type
 
3. Determining browser type using object detection
 
4. The Internet Explorer challenge
 
5. JavaScript and Forms
 
Home Browse Search Ask in Private Personal Folder   Help
powered by web hosting 
  Logged as: Guest