摘要: 1. hasOwn 是否是对象本身拥有的属性 var hasOwnProperty = Object.prototype.hasOwnProperty; function hasOwn (obj, key) { return hasOwnProperty.call(obj, key) } hasOw 阅读全文
posted @ 2021-09-23 11:24 魔都叛徒 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 1.拉起微信登录获取code码 https://open.weixin.qq.com/connect/oauth2/authorize?appid=xxxxxx&redirect_uri=客户端页面的回调地址&response_type=code&scope=snsapi_base&state=ST 阅读全文
posted @ 2020-04-14 01:26 魔都叛徒 阅读(199) 评论(0) 推荐(0) 编辑
摘要: /*判断一个元素是否在数组中*/ contains (arr, val) { return arr.indexOf(val) != -1 ? true : false; } /** * @param {arr} 数组 * @param {fn} 回调函数 * @return {undefined} 阅读全文
posted @ 2020-01-26 23:33 魔都叛徒 阅读(306) 评论(0) 推荐(0) 编辑
摘要: /** * 去除空格 * @param {str} * @param {type} * type: 1-所有空格 2-前后空格 3-前空格 4-后空格 * @return {String} */ trim (str, type) { type = type || 1 switch (type) { 阅读全文
posted @ 2020-01-26 23:31 魔都叛徒 阅读(177) 评论(0) 推荐(0) 编辑
摘要: /*随机数范围*/ random (min, max) { if (arguments.length 2) { return Math.floor(min + Math.random() * ( (max+1) - min )) }else{ return null; } } /*将阿拉伯数字翻译成 阅读全文
posted @ 2020-01-26 23:30 魔都叛徒 阅读(130) 评论(0) 推荐(0) 编辑
摘要: /** * 格式化时间 * * @param {time} 时间 * @param {cFormat} 格式 * @return {String} 字符串 * * @example formatTime('2018-1-29', '{y}/{m}/{d} {h}:{i}:{s}') // -> 20 阅读全文
posted @ 2020-01-26 23:29 魔都叛徒 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 1.type 类型判断 isString (o) { //是否字符串 return Object.prototype.toString.call(o).slice(8, -1) 'String' } isNumber (o) { //是否数字 return Object.prototype.toSt 阅读全文
posted @ 2020-01-26 23:28 魔都叛徒 阅读(217) 评论(0) 推荐(0) 编辑
摘要: /* 全选/全不选 */ function selectAll(objSelect) { if (objSelect.checked == true) { $("input[name='chkId']").attr("checked", true); $("input[name='chkAll']" 阅读全文
posted @ 2020-01-26 23:27 魔都叛徒 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 问题一:安卓收集拉起软件盘 input框覆盖一半 解决方案一: 键盘唤起时 问题二:ios微信浏览器,软键盘弹出后,input框焦点实际触发位置偏上,无法回归正常位置bug 解决方案: 阅读全文
posted @ 2019-10-29 13:27 魔都叛徒 阅读(331) 评论(0) 推荐(0) 编辑
摘要: #user nobody; worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_na 阅读全文
posted @ 2019-10-15 17:08 魔都叛徒 阅读(500) 评论(0) 推荐(0) 编辑