屏蔽右击事件
方法一:
document.onmousedown = noSourceExplorer;
function noSourceExplorer()
{
if (event.button == 2 | event.button == 3)
{
alert("想作弊??不让你看");
}
}
这种写法有弊端,点击中键以后再点右键就不受约束,why??
应该于 <body oncontextmenu="window.event.returnValue=false">
配合使用。