<script type="text/javascript" language="javascript">
//onbeforeunload是先刷新再关闭,onunload相反
window.onbeforeunload = function fun()
{
var n = window.event.screenX - window.screenLeft;
var b = n > document.documentElement.scrollWidth-20;
if(b && window.event.clientY < 0 || window.event.altKey)
{
alert('当前是关闭页面操作!');
}
else
{
alert('当前是刷新页面操作!');
}
}
window.clipboardData.setData('text','需要复制的值');--剪切板复制
document.οncοntextmenu=new Function('event.returnValue=true;');--禁用鼠标右键
document.onselectstart=new Function('event.returnValue=false;');--禁止复制
</script>