Disable right click on the website
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.
Disable right click on the website的更多相关文章
- ujquery.fancybox api开发文档中文翻译版
2016年11月17日11:57:14 基础使用 http://fancybox.net/howto 1. 首先,请确保您使用的是有效的DOCTYPE这是FancyBox看起来和功能正确需要. 2. ...
- 『翻译』Access USB Devices on the Web
https://developers.google.com/web/updates/2016/03/access-usb-devices-on-the-web Access USB Devices o ...
- pjax技术的应用
一.什么是PJAX? 现在有一些网站(apicloud, github)支持这样一种浏览方式,当你点击站内的一个连接的时候,不是传统的跳转到另外一个连接,而是类似ajax的局部刷新改变页面内容,但是 ...
- Knockoutjs 实践入门 (2) 绑定事件
Knockoutjs 绑定事件 Knockoutjs 不仅支持UI 元素的属性绑定到model的属性,还支持UI 元素的事件绑定model的事件. 需求: l click me button 每单击 ...
- 论checkbox和radio的样式美化问题
如果你下定决心要改变现有的默认的checkbox和radio的样式,那么我目前有两种办法: 1.自己动手写一个,也就是自己写代码实现将input的checkbox和radio默认的样式隐藏掉,使用绝对 ...
- jquery.ui.widget详解
案例详解 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <titl ...
- JqueryUI学习笔记-自动完成autocomplete
<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Inse ...
- jquery.pjax.js bug问题解决集锦
jquery.pjax 是一个很好的局部刷新插件,但实际应用过程是还是会有很多小问题,部分问题解决如下: 1.pjax 局部加载时候,IE 存在缓存问题,很容易理解,pjax是通过jquery的aja ...
- select2使用
一.简介 select2是Jquery用来代替选择框的一种组件.它让你可以定制下拉框,并且支持搜索.标记,远程数据源,无限滚动和其他更高级的功能.select2的下载地址为:https://selec ...
随机推荐
- MapReduce运行时出现java.lang.NoClassDefFoundError
最近在编写MapReduce程序时遇到了一个错误,错误提示信息为: Error: java.lang.ClassNotFoundException: org.apache.hadoop.hbase.H ...
- gem 相关命令
gem #查看gem源 gem sources # 删除默认的gem源 gem sources --remove http://rubygems.org/ # 增加taobao作为gem源 gem s ...
- android get uuid获取uuid
https://github.com/Paldom/UniqueDeviceID protected void getDeviceUUID(){ try { Context context = cor ...
- c++一些问题总结
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255) ...
- labview中的文件格式
- Win7 SP1语言包微软官方下载地址及使用方法 2
情形一:如果您的系统版本是企业版.旗舰版,可以在Windows update中检测语言包按照提示下载安装即可.如果觉得Windows update不方便的话,可以在本文第二部分中下载所需的语言包,下载 ...
- 完成端口iocp——在螺丝壳里做道场
WINDOWS 2000以后的操作系统才支持IOCP.WINSOCK2.0才支持IOCP. 首先要有一个WINSOCK2.PAS的WINSOCK2.0接口调用声明单元. WINSOCK的版本号: WI ...
- ado通用操作数据单元
DELPHI开发2层C/S数据库应用程序,许多人通过ADOQUERY或ADOTABLE直接操作数据库,其实这种方法虽然最为直接,但有其缺点:如果以后要将程序升级为3层C/S会非常困难.而通过像下面的通 ...
- Python基础 数字、字符串、列表、元组、字典
Number(数字)---> int.float.complex(复数) class int 在Python3中,整形(int)就是常见的整数:1,100,500,1000...... 浮点型( ...
- 在VSTO界面中,调用xll中的函数
最近研究各种有点迷茫了,原来Xll的加载宏直接可以在C#中调用的,我又各种Out了. 先说明一下,在VBA中,如何调用吧 XLLFound = Application.RegisterXLL(This ...