上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 67 下一页
摘要: 通常在获取或者设置checked,selected,readonly,disabled等的时候使用prop效果更好 attr是通过setAtrribute和getAttribute来设置的,使用的是DOM属性节点,而prop是通过document.getElementById(el)[name] = 阅读全文
posted @ 2018-05-19 11:35 贝尔塔猫 阅读(242) 评论(0) 推荐(0)
摘要: 使用 signature_pad canvas 库生成的图片太大。但又没有提供方法来压缩。 当然这是根据你canvas的画布大小决定的,某些原因导致我的画布就得是那么大。 随随便便一个图片转化为base64 之后就是200kb-300kb。所以得想办法压缩。 思路就是把生成的base64 图片再一次 阅读全文
posted @ 2018-05-17 08:35 贝尔塔猫 阅读(4180) 评论(0) 推荐(0)
摘要: 诀窍1:使用el.contains(e) 来判断点击的区域诀窍2:使用mouseup 诀窍3:完成之后,移除事件 阅读全文
posted @ 2018-05-17 08:32 贝尔塔猫 阅读(343) 评论(0) 推荐(0)
摘要: 使用 console.log(err); 是无法打印出来的。默认只能打印出错误信息。如图 需要使用console.table(err); 才可以打印。这算是一个hack吧 阅读全文
posted @ 2018-05-11 08:40 贝尔塔猫 阅读(978) 评论(0) 推荐(0)
摘要: 我们习惯使用application/json方式提交,所以会在ajax中指定contentType。 但请务必注意,我们提交的data必须是纯字符串才可以。所以一般会使用JSON.stringify()来转换一下。否则后端无法接受 但请务必注意,我们提交的data必须是纯字符串才可以。所以一般会使用 阅读全文
posted @ 2018-05-06 21:25 贝尔塔猫 阅读(1651) 评论(0) 推荐(0)
摘要: 安装:npm install pm2 -g #全局安装pm2 查看版本:pm2 -v 自动重启: pm2 start hello.js --watch 查看列表:pm2 list 查看日志: pm2 log <id|name> 停止服务:pm2 stop <id|name> 阅读全文
posted @ 2018-05-06 09:53 贝尔塔猫 阅读(277) 评论(0) 推荐(0)
摘要: 比较推荐使用百度翻译api 不推荐有道翻译,比较水。 http://ai.youdao.com/docs/doc-trans-api.s#p02 http://ai.youdao.com/docs/doc-trans-api.s#p08 阅读全文
posted @ 2018-04-25 17:14 贝尔塔猫 阅读(396) 评论(0) 推荐(0)
摘要: 命名变量 多行匹配注意:(.|\n)+? 阅读全文
posted @ 2018-04-25 17:09 贝尔塔猫 阅读(152) 评论(0) 推荐(0)
摘要: // 驼峰写法 function toUp ($str) { return preg_replace_callback('/\s(\w)|-(\w)/', function ($matches) { if (count($matches) > 2) { return strtoupper($matches[2]); } ... 阅读全文
posted @ 2018-04-25 15:37 贝尔塔猫 阅读(142) 评论(0) 推荐(0)
摘要: https://raw.githubusercontent.com/dragon8github/wx-h5/master/push.sh 阅读全文
posted @ 2018-04-23 11:30 贝尔塔猫 阅读(184) 评论(0) 推荐(0)
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 67 下一页