Javascript disables page refresh and decommission

Source: Internet
Author: User
[Javascript] & lt; scriptlanguage & quot; javascript & quot; & gt; // do not use the F5 key functiondocument. onkeydown () {if (event. keyCode116) {event. keyCode0; event. cancelBubbletrue; returnfa [javascript]

// Disable the F5 key
Function document. onkeydown ()
{
If (event. keyCode = 116)
{
Event. keyCode = 0;
Event. cancelBubble = true;
Return false;
}
}

// Disable context menu
Function document. oncontextmenu ()
{
Return false;
}

// The following Code enables full screen display
Function window. onload (){
Var Request = new Array (); // Save the Parameter
Var s = location. search. substring (1 );
If (s & s! = ""){
Var list = s. split ("&");
For (var I = 0; I <list. length; I ++ ){
Var pair = list [I]. split ("= ");
If (pair [0] & pair [0]! = ""){
Request [unescape (pair [0])] = unescape (pair [1]);
}
}
}

Var fullscreen = Request ["fullscreen"];
If (fullscreen! = "Yes "){
Var file = self. location;
Var a = window. open ("about: blank", "", "fullscreen = yes ")
Self. opener = null
Self. close ()
A. location = file + "? Fullscreen = yes ";
}
}
Script
Related Article

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.