Posted: Fri Jul 06, 2007 4:04 am Post subject: Protect, prevent, stop people from steal images on your site View Single Post
* Protect, prevent, stop people from steal images on your site
Copy the code bellow and save file as -> anti_steal_image.js
Code:
var clickmessage="Don't steal my images, ok!!!."
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.getElementById)
document.onmousedown=disableclick
else if (document.layers)
associateimages()
Then copy the code below to your website or the page that you want to protect and prevent people from steal your images. (the code bellow call the file anti_steal_image.js). You can add it in/between the <head> and </head> tags
Joined: 28 Dec 2007 Posts: 30
Gender: None specified
Posted: Fri Dec 28, 2007 3:07 am Post subject: : Protect, prevent, stop people from steal images on your site View Single Post
That is a great information for me. I am not a computer expert, anywhere I will definitely try it out.
As plhs09 mention, we can't totally stop. Some hackers still able to crack into your site.