javascript 限制只能输入数字
<input type=text onkeypress="return event.keyCode>=48&&event.keyCode<=57||(this.value.indexOf('.')<0?event.keyCode==46:false)" onpaste="return !clipboardData.getData('text').match(/\D/)" ondragenter="return false">
<asp:TextBox ID="TextBox1" runat="server" onkeyup='this.value=this.value.replace(/[^0-9.]/gi,"")' ></asp:TextBox>
相关文档:
每次用Google的
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(num);
&n ......
页面中有一个table包含两列,数据由后台生成,行数不定:(如图)
原始数据:
现在通过javascript进行查询,效果如下三图:
开始查询
查询中......
查询得到的自后结果
JAVASCRIPT代码:
JS代码
<script language="javascript" tpe="text/javascript">
function searchMateria ......
在prototype框架中的类继承实现机制
//为Object类添加静态方法:extend
Object.extend = function(destination, source) {
for(property in source) {
destination[property] = source[property];
}
return destination;
}
//通过Object类为每个对象添加方法 ......
我们有时获取 styl.width为空的时候,可以获取css中的width..
但ie and ff 是不同的。。
ie:
obj.currentStyle['width']
ff:
var css = document.defaultView.getComputedStyle(obj, null);
css.getPropertyValue('width') ......
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 ......