摘要:
//动态添加css stylevar comAddCSS = function (cssText) { var style = document.createElement('style'), //创建一个style元素 head = document.head || document.getEle 阅读全文
摘要:
// 获取网址中对象的值function GetQueryString(name) { var reg = new RegExp("(^|[&,?])" + name + "=([^&]*)(&|$)"); var r = decodeURI(location.href).substr(1).mat 阅读全文
摘要:
if (typeof(FileReader.prototype.readAsBinaryString) !== "function") { FileReader.prototype.readAsBinaryString = function (fileData) { var binary = ""; 阅读全文
摘要:
/*获取选中的文字*/var _getSelectedText = function() { if (window.getSelection) { return window.getSelection().toString(); } else if (document.getSelection) { 阅读全文
摘要:
var _checkIDCard = function(d){ var aCity={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",3 阅读全文
摘要:
//复制对象var cloneObj = function (obj) { function Clone() { } Clone.prototype = obj; var o = new Clone(); for (var a in o) { if (typeof o[a] == "object") 阅读全文
摘要:
/** * 字符转换为unicode */function chr2Unicode(str) { if ('' != str) { var st, t, i; st = ''; for (i = 1; i <= str.length; i++) { t = str.charCodeAt(i - 1) 阅读全文
摘要:
/** * 数组排序 * list为数组 parm为排序字段 b为排序方向 */var _sort = function (list, parm, b) { var down = function (x, y) { return (eval("x." + parm) > eval("y." + pa 阅读全文
摘要:
/** * 日期格式化 * format是想要格式化的格式 */Date.prototype.format = function (format) { var o = { "M+": this.getMonth() + 1, // month "d+": this.getDate(), // day 阅读全文
摘要:
//把字符串中所有的s1替换为s2 String.prototype.replaceAll = function (s1, s2) { return this.replace(new RegExp(s1, "gm"), s2);} //校验字符串是否为空String.prototype.isEmpt 阅读全文