You are here: irt.org | FAQ | JavaScript | Pointer | Q830 [ previous next ]
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.