会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
魔都叛徒
博客园
首页
新随笔
联系
管理
2021年9月23日
VUE 源码工具
摘要: 1. hasOwn 是否是对象本身拥有的属性 var hasOwnProperty = Object.prototype.hasOwnProperty; function hasOwn (obj, key) { return hasOwnProperty.call(obj, key) } hasOw
阅读全文
posted @ 2021-09-23 11:24 魔都叛徒
阅读(64)
评论(0)
推荐(0)
2020年4月14日
微信公众号支付 -- 笔记
摘要: 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 魔都叛徒
阅读(224)
评论(0)
推荐(0)
2020年1月26日
数组处理
摘要: /*判断一个元素是否在数组中*/ contains (arr, val) { return arr.indexOf(val) != -1 ? true : false; } /** * @param {arr} 数组 * @param {fn} 回调函数 * @return {undefined}
阅读全文
posted @ 2020-01-26 23:33 魔都叛徒
阅读(312)
评论(0)
推荐(0)
String操作
摘要: /** * 去除空格 * @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 魔都叛徒
阅读(179)
评论(0)
推荐(0)
number 处理
摘要: /*随机数范围*/ 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 魔都叛徒
阅读(135)
评论(0)
推荐(0)
date 处理
摘要: /** * 格式化时间 * * @param {time} 时间 * @param {cFormat} 格式 * @return {String} 字符串 * * @example formatTime('2018-1-29', '{y}/{m}/{d} {h}:{i}:{s}') // -> 20
阅读全文
posted @ 2020-01-26 23:29 魔都叛徒
阅读(192)
评论(0)
推荐(0)
type检查
摘要: 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 魔都叛徒
阅读(229)
评论(0)
推荐(0)
全选全不选,返回字符串长度,汉字计数为2,获取url中的参数 ,函数防抖,函数节流
摘要: /* 全选/全不选 */ function selectAll(objSelect) { if (objSelect.checked == true) { $("input[name='chkId']").attr("checked", true); $("input[name='chkAll']"
阅读全文
posted @ 2020-01-26 23:27 魔都叛徒
阅读(269)
评论(0)
推荐(0)
2019年10月29日
关于移动端兼容BUG问题收集及处理
摘要: 问题一:安卓收集拉起软件盘 input框覆盖一半 解决方案一: 键盘唤起时 问题二:ios微信浏览器,软键盘弹出后,input框焦点实际触发位置偏上,无法回归正常位置bug 解决方案:
阅读全文
posted @ 2019-10-29 13:27 魔都叛徒
阅读(343)
评论(0)
推荐(0)
2019年10月15日
nginx 1.6.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 魔都叛徒
阅读(523)
评论(0)
推荐(0)
下一页
公告