//#########################################################################//
//限制输入框只能输入数字(包括小数)
//Backspace | Home | End | Delete | Enter These keys are availabale
function checkKey(event) {
if(window.event) //whether IE
{
if(( event.keyCode>=48 && event.keyCode <=57 ) || (event.keyCode>=95 && event.keyCode<=105) || ( event.keyCode==110 || event.keyCode==8 || event.keyCode==46 || event.keyCode==35 || event.keyCode==36))
event.returnValue = true;
else
event.returnValue = false;
}else // FireFox
{
if(!((event.which>=48 && event.which<=57) || (event.which>=94 && event.which<=105) || (event.which==110 || event.which==8 || event.which==46 || event.which==35 || event.which==36)))
event.preventDefault();
}
}
分享到:
相关推荐
### JavaScript核心知识点解析 #### 一、构造函数与原型配置 **知识点概述:** 构造函数在JavaScript中用于定义对象模板,通常需要手动配置原型引用。构造函数是创建新对象的基础方式之一,它允许开发者定义一组...
5.8 Summary of JavaScript Statements 112 6. Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 6.1 Creating Objects...
`Handler` - **`Box`**:框选处理。 - **`Drag`**:拖拽处理。 - **`Feature`**:特征处理。 - **`Keyboard`**:键盘事件处理。 - **`MouseWheel`**:鼠标滚轮事件处理。 - **`Path`**:路径处理。 - **`Point`**...
Working with WebVR directly requires knowledge of JavaScript and WebGL. Interfacing with a VR headset using WebVR is typically done in two phases: Setup. The application detects the headset, ...
- **Document Ready Handler:** To ensure that the DOM is fully loaded before executing scripts, JQuery provides the `.ready()` function. This ensures that the script runs only when the page is ready ...
Simply add a promise fullfillment handler to the promise using then: html2canvas(document.body).then(function(canvas) { document.body.appendChild(canvas); }); Building The library uses grunt for ...
- **The Document Ready Handler**: The `$(document).ready()` function ensures that the DOM is fully loaded before running any JavaScript code, preventing errors related to elements not being ready. ...
You can execute JavaScript code and access all the JavaScript objects directly from your .NET code. Access their properties or even call a JavaScript function are all different options available to ...
You can redirect all of the output of your scripts to a function. For ; example, if you set output_handler to "mb_output_handler", character ; encoding will be transparently converted to the ...
* @param filePath -> the path to the file */ readFile : function ( filePath ) { return new Promise ( function ( resolve , reject ) { let lineReader = require ( 'readline' ) . createInterface ( {
This includes label captions, validator messages, the size and maxLength of textboxes, style of the label, textbox, text button, link buttons, font name, colors, etc. There are two types of action ...
Bug fix: When a IW application was compiled with runtime packages, TIWAppInfo.GetAppFullFileName was returning the name and path of the BPL file, not the EXE/DLL main file Bug fix: TContentRedirect ...
介绍 该模块旨在提供直观的功能以与AWS的S3一起使用。... * @param s3LocalPath -> the local path of the files in the bucket (/remotes/Samsung) * @param destPath -> the path to which the files will be d
介绍 该模块包含基本的fileHandler脚本,可在每个npm项目中实施,以简化生活,而不仅仅是记住所有事情:) ... * Will return the path to the parent of a file */ getParentDirPath : function ( filePath ) {
/*Start of the object add event handler script*/ // 假设有一个DOM对象 var object = document.getElementById('someElementId'); if(typeof(MultiHandle) != "undefined"){ var mup_handler = object.mh_...
介绍 该模块包含一个基本的zip文件操作功能,可在npm项目中实现。 安装 通过npm安装: npm i os-zip-handler 用法 需要zip处理程序: ... * the zip will be extracted in the directory they contain)
Sortable is a <s>minimalist</s> JavaScript library for reorderable drag-and-drop lists. Demo: http://rubaxa.github.io/Sortable/ ## Features * Supports touch devices and [modern]...
Rave also offers custom playlist creation and editing, or you can manage what appears in the player by directing Rave to a folder full of media files on your site. Wimpy Rave v2.0.31 Jun. 25, 2012 - ...
SimpleUpload ( { button : 'upload-btn' , // HTML element used as upload button url : '/PathTo/UploadHandler' , // URL of server-side upload handler name : 'uploadfile' // Parameter name of the ...