摘要: 获取元素坐标var getPos:function(o){//取元素坐标 var x = 0, y = 0; do{ x += o.offsetLeft; y += o.offsetTop; }while(o=o.offsetParent); return {'x':x,'y':y};} Firebug的使用http://www.uedsky.com/sky/article/firebug-tutorial.html 获取当前script文件的路径var strJsPath='';(function(){ try { throw Error(&q 阅读全文
posted @ 2011-05-26 11:20 polymorphic 阅读(496) 评论(0) 推荐(0) 编辑
摘要: //-------常用js Function //------------start 已验证---------------////定义报错信息var MSG_ERR001="$1不能为空!";var MSG_ERR002="$1的文字格式为$2!";var MSG_ERR003="$1不能超过$2个字节!";var MSG_ERR004="不能删除$1!!";/*** alert : 弹出出错信息* 引数 : sMsg 报错信息* sParam1 引数1* sParam2 引数2* sParam3 引数3* 返回值 阅读全文
posted @ 2011-05-26 10:59 polymorphic 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 在一个文本框里输入一个数值,在另一个地方显示的时候自动转换成大写,数值是一个钱数,保留两位小数,例如100.00,壹佰元零角零分。View Code 1 <script type="text/javascript"> 2 //主函数 3 function DX(n) { 4 if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)) 5 return "数据非法"; 6 var unit = "千百拾亿千百拾万千百拾元角分", str = ""; 7 n += "00&quo 阅读全文
posted @ 2011-05-26 10:46 polymorphic 阅读(445) 评论(0) 推荐(1) 编辑
摘要: 1.1、在Asp.Net TextBox 控件的 OnKeyPress 事件中指定输入键盘码必须为数字:<asp:TextBox ID="TextBox" runat="server" OnKeyPress="if(((event.keyCode>=48)&&(event.keyCode <=57))||(event.keyCode==46)) {event.returnValue=true;} else{event.returnValue=false;}" MaxLength="15&qu 阅读全文
posted @ 2011-05-26 10:34 polymorphic 阅读(248) 评论(0) 推荐(0) 编辑