Jump to content

Adding some javascript code in the <head> crashes the web


Recommended Posts

I'm up to disable the right mouse button in order to prevent my images to be stolen. However, as soon as i write some javascript code en the <head> my web page collapse. Why? Prestashop has any security issue with javascript code?

This is it (but i really don't think it's problematic in any sense):


function clickDerecho(){
   if(event.button==2){
       return false;        
   }    
}

document.onmousedown = clickDerecho;
document.oncontextmenu = clickDerecho;



I tried deleting several lines, but the problem persists. So, what is it?

Link to comment
Share on other sites

seriously not much of a point to disabling right click. That will only stop someone with very primitive understandings of the internet. If someone wants your product images they will get them. They will more than likely use a program that will scrap you site. And get them all in a few minutes instead of right clicking and hitting save as.

Your best bet if you don't want your images used is to watermark them :) Then if someone does use them they are advertising for you :)

Link to comment
Share on other sites

If someone wants your product images they will get them. They will more than likely use a program that will scrap you site. And get them all in a few minutes instead of right clicking and hitting save as.

Your best bet if you don't want your images used is to watermark them :) Then if someone does use them they are advertising for you :)


That's right. However the code is very little and don't disturbs. It's just for image downloaders, to call their attention for a second.

Yes, we are using watermarks also.

Thanks for commenting.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...