Right-click prohibited/select prohibited/drag prohibited clear clipboard

Source: Internet
Author: User

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.tar get;
}

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;
}

// ************************* Clear the clipboard ************ *************
Function keyDown ()
{
Var iekey = event. keyCode;
// Alert (iekey );
If (iekey = 42)
{
// Window. clipboardData. setData ('img ','')
 
Window. clipboardData. clearData ();
}
}

 

Note: The above is the disable. js file.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------------------- 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> <! -- Disable right-click -->
<Script src = 'HTTP: // track.chinahr.com/tracker.js'> </script> <! -- Access statistics -->

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.