Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q830 How can I stop people who try to save or print images of my new window by clicking with the right button of their mouse?

irt.org | Knowledge Base | JavaScript | Pointer | Q830 [ previous next ]

Q830 How can I stop people who try to save or print images of my new window by clicking with the right button of their mouse?

It can't be done. You can make it harder by using image swapping techniques that use the onMouseOver onMouseOut event handlers to swap the image to, say, a blank image, although anyone with any knowledge of JavaScript can defeat it. Disabling JavaScript also defeats it.

<SCRIPT LANGUAGE="JavaScript"><!--
if (document.images) {
    blank = new Image();
    blank.src = 'blank.gif';
}

function myVoid() {}
//--></SCRIPT>

<A HREF="#" onClick="this.href = 'javascript:myVoid()'"><IMG SRC="picture.gif" WIDTH="100" HEIGHT="100" BORDER="0" onMouseOver="if (document.images) this.src = blank.src" onMouseOut="if (dcoument.images) this.src = 'picture.gif'"></A>

There are Java-based products that make right clicking to save images near impossible. Check out: http://www.artistscope.com.

Also see FAQ #969 How can I suppress a right mouse click?.

Robert Slater writes:

You might want to add that also, they can get the image just by looking at the code, determining the source of the image, and then entering in that url. No javascript knowledge is even necessary to steal it. Let's face it - the web is about sharing, not coveting.

Feedback on 'Q830 How can I stop people who try to save or print images of my new window by clicking with the right button of their mouse?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.