易截截图软件、单文件、免安装、纯绿色、仅160KB

JavaScript TextBox输入数字控制

var OnPasteCheckIntNum = function()
{
    if(window.clipboardData)
    {
        if(isNaN(window.clipboardData.getData('text')))
        {
            clipboardData.setData('text','');
        }
        else
        {
            //clipboardData.setData('text',clipboardData.getData('text'))
            clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))
        }
    }
    else if(navigator.userAgent.indexOf("Opera") != -1)
    {
        if(isNaN(window.location))
        {
            //window.location = window.location.replace(/[^\d]/g,'');
            window.location = '';
        }
    }
};
var OnPasteCheckDecimal = function(id)
{   
    return function()
    {
        if(window.clipboardData)
        {
            if(isNaN(window.clipboardData.getData('text') + id.value))
            {
                clipboardData.setData('text','');
            }
     &n


相关文档:

Javascript中最常用的55个经典技巧

 1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)><td>no</table> 可用于Table
2. <body onselectstart="return false"> 取消选取、防止复制
3. onpaste="return false" 不准粘贴
4. oncopy="return false;" oncut="re ......

ie firefox javascript

 1.document.formName.item("itemName") 问题
说明:IE下,可以使用document.formName.item("itemName")或 document.formName.elements["elementName"];Firefox下,只能使用 document.formName.elements["elementName"].
解决方法:统一使用document.formName.elements["elementName"].
2.集合类对象问题
说明:IE下,可 ......

Javascript继承之对象冒充法

例如:有三个类classX,classY,classZ
classZ分别继承classX和classY
于是就有下面的写法:
function ClassZ(){
this.newMethod=classX;
this.newMethod();
delete this.newMethod;
this.newMethod=classY;
this.newMethod();
delete this.newMethod;
}
这种写法存在一个弊端.。如果classX和classY有具有同名的属 ......

用JavaScript显示广告栏

 //广告栏
function MoveLeftLayer(layerName) {
var x = 5;
var y = 100;// 左侧广告距离页首高度
var diff = (document.body.scrollTop + y - document.all.AdLayer1.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = parseInt(y)");
e ......

用JavaScript实现文字围绕鼠标转动

 if (document.all)
{
yourLogo = "欢迎进入鲜花工坊网!";           <!--待旋转的文字-->
logoFont = "Arial";                       ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号