禁用粘贴事件
$("#input" ).unbind("paste" );
$("#input" ).bind(function () {
var el = $(this );
setTimeout({
var text = $el.val();
alert(text);
},100 );
}
);
禁止ctrl + C
<script type ="text/javascript" >
document.onkeydown=function () {
if ((event.ctrlKey) && (window.event.keycode==67 )){
event.returnValue=false ;
alert("Ctrl+C被禁止啦!" );
}
}
document.onmousedown=function () {
if (event.button==2 ){
event.returnValue=false ;
alert("右键被禁止啦!" );
}
}
</scription>
function clear () {
Source=document.body.firstChild.data;
document.open();
document.close();
document.title=”看不到源代码”;
document.body.innerHTML=Source;
}</script>
function Click () {
if (window.event.srcElement.tagName==”IMG”)
{
alert(‘图片直接右键’);
window.event.returnValue=false ;
}
}
document.oncontextmenu=Click;
<META HTTP-EQUIV=”imagetoolbar” CONTENT=”no”>
插入图片时加入galleryimg属性
<img galleryimg=”no” src=””>
禁止右键保存
function click () {
alert(‘对不起,您不能保存此图片,谢谢您的理解和支持!’) }
function click1 () {
if (event.button==2 ) {alert(‘对不起,您不能保存此图片,谢谢您的理解和支持!’) }}
function CtrlKeyDown () {
if (event.ctrlKey) {alert(‘不当的拷贝将损害您的系统!’) }}
document.onkeydown=CtrlKeyDown;
document.onselectstart=click;
document.onmousedown=click1;
function document .onmousedown ()
{
if (event.button==2 ||event.button==3 )
{
alert( “右健被禁止 “)
return false
}
}