⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 keydownevent.js

📁 社区服务信息管理系统 通过在windos2003和iis6.0的环境下利用Visual Studio.Net(C#)和SQL SERVER2000进行编程实践
💻 JS
字号:
/*
	File Version Start - Do not remove this if you are modifying the file
	Build: 9.5.0
	File Version End
*/
/*
    this function is used to verify whether the 'Enter' key is pressed.
    if the 'Enter' key is pressed, then either call the event handler function passed in as a parameter (evntHdlrName)
    or if evntHdlrName is an empty string, submit the form that contains the input box (that triggers this function).  
    The form name is passed in as the third parameter, if it's an empty string, it's set to 0 by default.
    The first parameter is an event object 
    
    written by Paul Chong, 17th May 01
*/

function keydownfn(e, evntHdlrName, formName)
{	
    var nav4;
    var keyPressed;

    //check if the brower is Netscape Navigator 4 or not
    var nav4 = window.Event ? true : false;
	
	//if browser is Navigator 4, the key pressed is called <event object>.which else it's called <event object>.keyCode
	keyPressed = nav4 ? e.which : e.keyCode;
		
    if (keyPressed == 13)
    {	
        if (evntHdlrName != "")
		{	
			// append empty parentheses if none given
			if(evntHdlrName.substr(evntHdlrName.length-1) != ")")
				evntHdlrName += "()";
			eval(evntHdlrName);
        }
        else
        {
			if (formName == "")
				formName = 0;
            document.forms[formName].submit();
        }
    }
    return true;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -