1 2 3 4
摘要: getFloat = (num, n) => { n = n ? parseInt(n) : 0; if(n <= 0) { return Math.round(num); } num = Math.round(num * Math.pow(10, n)) / Math.pow(10, n); // 阅读全文
posted @ 2020-07-23 10:38 无序 阅读(146) 评论(0) 推荐(0) 编辑
摘要: <head> 标签区域加上 <meta name="referrer" content="no-referrer"> 阅读全文
posted @ 2020-05-09 11:21 无序 阅读(116) 评论(0) 推荐(0) 编辑
摘要: window.open('http://view.officeapps.live.com/op/view.aspx?src=' + file.url) 阅读全文
posted @ 2020-05-07 17:44 无序 阅读(1288) 评论(0) 推荐(0) 编辑
摘要: new Date(item.startTime.replace(/-/g, '/') dateFormat('hh:mm', new Date(item.startTime.replace(/-/g, '/'))) 阅读全文
posted @ 2020-04-15 15:03 无序 阅读(176) 评论(0) 推荐(0) 编辑
摘要: <script> function thousands(num){ var str = num.toString(); var reg = str.indexOf(".") > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g; return s 阅读全文
posted @ 2020-03-27 14:23 无序 阅读(6499) 评论(0) 推荐(1) 编辑
摘要: 项目中经常会遇到点击按钮复制订单号、订单id等内容到粘贴板中的需求。可是通常我们都是用Ctrl + c或右击复制的,别操心,js也是有复制命令的,那就是document.execCommand('copy'); 这个命令会将选中的内容复制到粘贴板中,那岂不是还需要选中?别急input和textare 阅读全文
posted @ 2020-03-26 16:53 无序 阅读(3022) 评论(0) 推荐(0) 编辑
摘要: Promise,我们了解到promise是ES6为解决异步回调而生,避免出现这种回调地狱,那么为何又需要Async/Await呢?你是不是和我一样对Async/Await感兴趣以及想知道如何使用,下面一起来看看这篇文章:Async/Await替代Promise的6个理由。 什么是Async/Awai 阅读全文
posted @ 2020-03-02 09:27 无序 阅读(679) 评论(0) 推荐(0) 编辑
摘要: Array.prototype.remove = function(val) { var index = this.indexOf(val); if (index > -1) { this.splice(index, 1); } }; function getNames(array,childs,a 阅读全文
posted @ 2020-01-13 08:50 无序 阅读(295) 评论(0) 推荐(0) 编辑
摘要: sandbox="allow-forms allow-scripts allow-same-origin allow-popups" 阅读全文
posted @ 2019-08-24 16:07 无序 阅读(1570) 评论(0) 推荐(0) 编辑
摘要: { "git.ignoreMissingGitWarning": true, "editor.multiCursorModifier": "ctrlCmd", "editor.snippetSuggestions": "top", "editor.formatOnPaste": false, "fi 阅读全文
posted @ 2019-07-02 10:38 无序 阅读(850) 评论(0) 推荐(0) 编辑