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