上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 58 下一页
摘要: 邮箱:functionisEmail(email){varfilter=/^/s*([A-Za-z0-9_-]+(/./w+)*@(/w+/.)+/w{2,3})/s*$/;if(!filter.test(email)){alert("emailerror!");}else{alert("emailok!");}}电话:functionisTel(tel){varfilter=/^/s*[.0-9]{8,11}/s*$/;if(!filter.test(tel)||tel<30000000||tel>20000000000){alert(&q 阅读全文
posted @ 2011-02-25 09:46 清山博客 阅读(1155) 评论(0) 推荐(1)
摘要: javascript:<mce:script language="javascript"><!-- function checkLength(which) { var maxChars = 20; if (which.value.length > maxChars) which.value = which.value.substring(0,maxChars); var curr = maxChars - which.value.length; ... 阅读全文
posted @ 2011-02-18 13:34 清山博客 阅读(291) 评论(0) 推荐(0)
摘要: 当 IDENTITY_INSERT 设置为 OFF 时,不能向表"A" 中的标识列插入显示值。解决方法:1.有一项数据(message_id)如是自动添写的。把那列删掉就可以写进去了。 具体为:原始:"insert into user_message(message_id,user_id,message_content) Values(11,333,'hahaha')"; //报错改成:"insert into user_message(user_id,message_content) Values(333,'hahah 阅读全文
posted @ 2011-02-18 10:27 清山博客 阅读(3223) 评论(0) 推荐(0)
摘要: protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow)//如果是为数据行 { ImageButton imgbtnup = (ImageButton)e.Row.Cells[1].FindControl("btnMoveUp");//找控件 imgbtnup.CommandArgument = e.Row.RowInde... 阅读全文
posted @ 2011-01-28 13:42 清山博客 阅读(183) 评论(0) 推荐(0)
摘要: 本文列出jquery一些应用小技巧,比如有禁止右键点击、隐藏搜索文本框文 字、在新窗口中打开链接、检测浏览器、预加载图片、页面样式切换、所有列等高、动态控制页面字体大小、获得鼠标指针的X值Y值、验证元素是否为空、替换元 素、延迟加载、验证元素是否存在于Jquery集合中、使DIV可点击、克隆对象、使元素居中、计算元素个数、使用Google主机上的Jquery类 库、禁用Jquery效果、解决Jquery类库与其他Javascript类库冲突问题。请看下文jquery技巧:1、禁止右键点 击1$(document).ready(function(){2$(document).bind(" 阅读全文
posted @ 2011-01-20 13:54 清山博客 阅读(132) 评论(0) 推荐(0)
摘要: 获取元素的真实,最终的css样式属性的函数:function getStyle(elem, name) { //如果存在于style[]中,直接返回 if (elem.style[name]){ return elem.style[name]; } //尝试使用IE的方法 else if (elem.currentStyle) { return elem.currentStyle[name]; } //或者使用W3C的方法 else if (document.defaultView && document.de... 阅读全文
posted @ 2011-01-02 16:14 清山博客 阅读(157) 评论(0) 推荐(0)
摘要: 一、传统的方法:// 例1:查找第一个<form>元素并为其绑定submit事件处理函数document.getElementsByTagName(“form”)[0].onsubmit = function(e){ return stopDefault( e );//停止表单提交的默认行为}; // 例2:为页面body元素绑定键盘敲击事件document.body.onkeypress = myKeyPressHandler; // 例3:为页面加载完毕绑定事件window.onload = function(){ … }; 二、W3C的方法(IE不支持):// 例1:查找第. 阅读全文
posted @ 2011-01-02 16:02 清山博客 阅读(209) 评论(0) 推荐(0)
摘要: 获取和设置元素特性的值的函数function attr(elem, name, value) { //确保提供的name是正确的 if ( !name || name.constructor != String ) return ''; // 检查name是否处在怪异命名的情形中 name = { ‘for': 'htmlFor', 'class': 'className' }[name] || name; // 如果用户传入了value; if ( value != null ) { // 首先使用快捷方式 elem[n 阅读全文
posted @ 2011-01-02 15:49 清山博客 阅读(209) 评论(0) 推荐(0)
摘要: prev()函数:返回相关元素的前一兄弟节点 function prev(elem) { do { elem = elem.previousSibling; } while (elem && elem.nodeType != 1); return elem; } next()函数:返回相关元素的后一兄弟节点 function next(elem) { do { elem = elem.nextSibling; } while (elem && elem.nodeType !... 阅读全文
posted @ 2011-01-02 15:46 清山博客 阅读(177) 评论(0) 推荐(0)
摘要: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf 阅读全文
posted @ 2010-12-30 18:09 清山博客 阅读(825) 评论(0) 推荐(0)
上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 58 下一页