-
FEATURED COMPONENTS
First time here? Check out the FAQ!
how to disable right click view the .zul page property..? i want to use zscript disable visitor view my .zul page property when they click right mouse key?
add this section to your zk.xml to prevent the right click :
<device-config> <device-type>ajax</device-type> <!-- configures zk to reload the page if timeout happnes --> <timeout-uri></timeout-uri> <!-- configure zk to automatic reload timeout-uri without requireing a event from user --> <automatic-timeout/> <!-- Custom javascript snippets --> <embed> <![CDATA[<script type="text/javascript"> <script language=JavaScript> //Disable right mouse click Script //By Maximus ([email protected]) w/ mods by DynamicDrive //For full source code, visit http://www.dynamicdrive.com function clickIE4(){ if (event.button==2){ return false; } } function clickNS4(e){ if (document.layers||document.getElementById&&!document.all){ if (e.which==2||e.which==3){ return false; } } } if (document.layers){ document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS4; } else if (document.all&&!document.getElementById){ document.onmousedown=clickIE4; } document.oncontextmenu=new Function("return false"); </script> ]]> </embed> </device-config>
Thanks for sharing hosarb
Assuming you are trying to disabling the right click option "View page source", I hope you are not doing this for security because it won't work. It is possible to get at the page source via various methods if anyone really wants to. All disabling the right click will do is make it more difficult for the average user.
Asked: 2011-03-16 08:50:34 +0800
Seen: 470 times
Last updated: Nov 26 '11