大家好, 我正在创建一个文档管理系统。这是客户的要求。 1)当我们点击创建链接时,文档应该在浏览器中打开 - 完成 2)防止从某些外部文档复制并粘贴到系统文件 - 防止右键单击和cntrl c反之亦然 3)应用程序中的复制/粘贴应该可用.--请指导我最后一点如何进行此操作。
解决方案防止右键单击... < script > var isNS =(navigator.appName ==Netscape)? 1:0; if(navigator.appName ==Netscape)document.captureEvents(Event.MOUSEDOWN || Event.MOUSEUP); 函数mischandler(){返回false; } 函数mousehandler(e){ var myevent =(isNS)? e:事件; var eventbutton =(isNS)? myevent.which:myevent.button; if((eventbutton == 2)||(eventbutton == 3))return false; } document.oncontextmenu = mischandler; document.onmousedown = mousehandler; document.onmouseup = mousehandler; < / script >
身体标签
< body oncontextmenu =return falseonselectstart =return falseöndragstart=return false>< / body>
单独防止复制和粘贴 java脚本中的 function killCopy(e){ return false } function reEnable(){ return true } document.onselectstart = new 功能( return false) if ( window.sidebar){ document.onmousedown = killCopy document.onclick = reEnable }
in html body标签 ondragstart =return falseonselectstart =return falseoncontextmenu =return false
Hi All, I am creating a Document Management System.Below are the requirment from the client. 1) When we click on create link a document should get open within the browser - Done 2) Prevent copy from some external document and paste in the document of the system - Prevented right click and cntrl c and vice versa 3) Copy/Paste within the application should be available.-- Please guide me on the last point how to go ahead of this.
解决方案 To Prevent right Click ... <script> var isNS = (navigator.appName == "Netscape") ? 1 : 0; if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP); function mischandler(){ return false; } function mousehandler(e){ var myevent = (isNS) ? e : event; var eventbutton = (isNS) ? myevent.which : myevent.button; if((eventbutton==2)||(eventbutton==3)) return false; } document.oncontextmenu = mischandler; document.onmousedown = mousehandler; document.onmouseup = mousehandler; </script>At body tag
<body oncontextmenu="return false" onselectstart="return false" öndragstart="return false"></body> To Prevent Copy and Paste alone in java script function killCopy(e){ return false } function reEnable(){ return true } document.onselectstart=new Function ("return false") if (window.sidebar){ document.onmousedown=killCopy document.onclick=reEnable }in html body tag ondragstart="return false" onselectstart="return false" oncontextmenu="return false"
更多推荐
防止复制粘贴选项
发布评论