Thursday, January 13, 2011

Event Handling with Java Script - More examples ( Tutorial 3 of 3)

Disable the back button on a browser

<script language="javascript" type="text/javascript">
function noBack()
{
window.history.forward()
}
noBack();
window.inhibited_load=noBack;
window.onpageshow=function(evt){if(evt.persisted)noBack()}
window.inhibited_unload=function(){void(0)}
</script>


Disable the Right Click of Mouse

<script LANGUAGE="JavaScript">
<!-- 
function click() 

if (event.button==2) 

alert('You Can NOT use the Right Mouse Button . No Sorry , It is my manager's spec!'); 


document.onmousedown=click 
// --> 
</script>


More will added in the next few days....

No comments:

Post a Comment

subversion video