摘要: //全局文本替换 String.prototype.replaceAll = function(s1,s2){ return this.replace(new RegExp(s1,"gm"),s2); } //去前后空格 String.prototype.Trim = function(){ return this.replace(/(^\s*)|(\s*$)/g, ""); } //去... 阅读全文
posted @ 2011-12-27 16:03 Cat.1988 阅读(268) 评论(0) 推荐(0) 编辑
摘要: 1、引入md5.JS 2、md5.JS 内容如下 3、加密 阅读全文
posted @ 2011-12-27 15:43 Cat.1988 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 1、直接给对象添加事件 2、通过监听方式添加事件,多事件可并存,按添加顺序执行。 javascript事件解说 一般事件 onclick IE3、N2 鼠标点击时触发此事件 ondblclick IE4、N4 鼠标双击时触发此事件 onmousedown IE4、N4 按下鼠标时触发此事件 onmo 阅读全文
posted @ 2011-12-27 12:14 Cat.1988 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 1 function Select(){}; 2 /** 3 * 根据指定的JSON对象来生成指定的select的options项(清除原来的options). 4 */ 5 Select.create = function(/*string*/selectId,/*json object*/json) { 6 Select.clear(selectId); ... 阅读全文
posted @ 2011-12-27 12:12 Cat.1988 阅读(301) 评论(0) 推荐(0) 编辑
摘要: function JsLoader(){}; JsLoader.loaded = []; JsLoader.prototype = { _path : null,//要加载的JS的路径 _head : null,//文档对象的head头对象 /** * 主要调用方法. */ require : function(jsPath,callback) ... 阅读全文
posted @ 2011-12-27 12:11 Cat.1988 阅读(367) 评论(0) 推荐(0) 编辑
摘要: functionHighLight(){}; HighLight.options = { id : null, className : null, interval : 255, times : 3000 }; HighLight.prototype = { exe :function(options) { var_options = {};... 阅读全文
posted @ 2011-12-27 12:09 Cat.1988 阅读(185) 评论(0) 推荐(0) 编辑
摘要: function Password(){}; Password.check = function(pwd,tipsDivId) { var id = Password.getResult(pwd); var msg = ["密码过短","密码强度差","密码强度良好","密码强度高"]; var sty = [-45,-30,-15,0]; var col = ["#999... 阅读全文
posted @ 2011-12-27 12:08 Cat.1988 阅读(158) 评论(0) 推荐(0) 编辑
摘要: var drag_=false var D=new Function('obj','return document.getElementById(obj);') var oevent=new Function('e','if (!e) e = window.event;return e') function Move_obj(obj){ var x,y; D(obj).onmous... 阅读全文
posted @ 2011-12-27 12:05 Cat.1988 阅读(145) 评论(0) 推荐(0) 编辑
摘要: function creatediv(divcnt){ for(var i=0;i<divcnt;i++)//创建div数量 { var objdiv = document.createElement("DIV");//创建DIV节点 var objname="shop_" + i;//设置name属性 objdiv.id = obj... 阅读全文
posted @ 2011-12-27 12:04 Cat.1988 阅读(284) 评论(0) 推荐(0) 编辑