function FixPrototypeForGecko()
{
HTMLElement.prototype.__defineGetter__("runtimeStyle",element_prototype_get_runtimeStyle);
window.constructor.prototype.__defineGetter__("event",window_prototype_get_event);
Event.prototype.__defineGetter__("srcElement",event_prototype_get_srcElement);
}
function element_prototype_get_runtimeStyle()
{
return this.style;
}
function window_prototype_get_event()
{
return SearchEvent();
}
function event_prototype_get_srcElement()
{
return this.target;
}
function SearchEvent()
{
//IE
if(document.all)
return window.event;
func=SearchEvent.caller;
while(func!=null)
{
var arg0=func.arguments[0];
if(arg0)
{
if(arg0.constructor==Event|| arg0.constructor ==MouseEvent)
return arg0;
}
func=func.caller;
}
return null;
}
if(window.addEventListener)
{
FixPrototypeForGecko();
}
//***********************禁止右键***************************
if (window.Event)
document.captureEvents(Event.MOUSEUP);
function nocontextmenu()
{
if(event.cancelBubble)
event.cancelBubble = true
event.returnValue = false;
return false;
}
function norightclick(e)
{
if (window.Event)
{
if (e.which == 2 || e.which == 3)
return false;
}
else
if (event.button == 2 || event.button == 3)
{
if(event.cancelBubble)
event.cancelBubble = true
event.returnValue = false;
return false;
}
}
//************************禁止选择***************************
function noSelect()
{
return false;
}
//************************禁止拖曳***************************
function noDragstart()
{
return false;
}
//************************清空剪切板*************************
function keyDown()
{
var iekey = event.keyCode;
//alert(iekey);
if(iekey == 42)
{
//window.clipboardData.setData('img','')
window.clipboardData.clearData();
}
}
注释:上面为 disable.js 文件
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!---------------------http://page.chinahr.com/default/20100302000429_427163_10423/index.aspx-------------------------------!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
</head>
<body><script type="text/javascript">if (typeof(_jtMC) == "function") _jtAE(document.body,"mousedown",_jtMC);if (typeof(_jtPageUnload) == "function") document.body.onunload=_jtPageUnload;</script>
<noscript><iframe src='*.htm'></iframe></noscript>
<script src='http://www.cnblogs.com/commonJs/disable.js'></script>
<SCRIPT language=JavaScript>
document.oncontextmenu = nocontextmenu;
document.onmousedown = norightclick;
document.ondragstart = noDragstart;
document.onselectstart = noSelect;
if(document.selection)
document.onselect = document.selection.empty();
document.onkeydown = keyDown;
</SCRIPT> <!-- 禁止右键-->
<script src='http://track.chinahr.com/tracker.js'></script><!-- 访问统计-->