Many developers/website owners like to keep their website images personal and don't want anyone to copy it from their website.

In order to accomplish this place the following java script code in between the <head>  </head> tag of your master page:

<script type="text/javascript">

    var message = "Sorry, Right Clicks have been disabled"; // Message for the alert box

    // Don't edit below!

    function click(e) {
if (document.all) {
if (event.button == 2 || event.button == 3) {
alert(message);
return false;
}
}
else {
if (e.button == 2 || e.button == 3) {
e.preventDefault();
e.stopPropagation();
alert(message);
return false;
}
}
}
if (document.all) {
document.onmousedown = click;
}
else {
document.onclick = click;
}
</script>

P.S. Just by disabling the right click doesn't stop anyone from downloading or copying from any website as there are many other ways to do that.

最新文章

  1. 【总结】富有表现力的JavaScript
  2. js隐藏div和class
  3. Android 手机号码格式验证
  4. MFC中挂起线程和恢复线程
  5. (四)学习MVC之修改个人资料和身份验证登陆
  6. QQ登录网站接入
  7. Oracle 字符集的查看和修改
  8. 【转】JavaScript中的constructor与prototype
  9. 【Java进阶】——初识数据库连接池
  10. 网页标题(title)动态改变
  11. php 守护进程类
  12. dynamic initializer和全局变量
  13. ASP.NET 实现PDF文件下载[转]
  14. 基于SwiperJs的H5/移动端下拉刷新上拉加载更多
  15. Redis与Mysql数据同步
  16. F#周报2018年第51期
  17. hdu 2089 数位dp
  18. Cocos2d-x移植android增加震动效果
  19. c# Use NAudio Library to Convert MP3 audio into WAV audio(将Mp3格式转换成Wav格式)
  20. Java中Io流操作-File类的常用操作-创建文件,创建文件夹

热门文章

  1. 《学习OpenCV》练习题第四章第三题a
  2. carthage 简单使用步骤
  3. js_sl 无缝切换
  4. &lt;转载&gt;linux下内存泄露查找、BUG调试
  5. JavaScript学习——内置属性
  6. access检测表没有的字段,添加之
  7. win2008 64位 + oracle11G 64位 IIS7.5 配置WEBSERVICE
  8. HDU 4870Rating(推公式)
  9. IE浏览器在虚拟机中无法正常显示字符
  10. 使用struts dojo ajax源码案例