Loading

随笔分类 -  js

摘要:1、url参数转对象 /** * @param {string} url * @returns {Object} */ // 方法一: function param2Obj(url) { const search = decodeURIComponent(url.split("?")[1]).rep 阅读全文
posted @ 2021-07-08 18:01 头牌彭鱼宴、 阅读(121) 评论(0) 推荐(0)
摘要:Date.prototype.Format = function (fmt) { // author: meizz var o = { "M+": this.getMonth() + 1, // 月份 "d+": this.getDate(), // 日 "h+": this.getHours(), 阅读全文
posted @ 2021-07-08 16:41 头牌彭鱼宴、 阅读(336) 评论(0) 推荐(0)
摘要:function getRandomNum(min, max) { // +1 包含最大值 return Math.floor(Math.random() * (max-min + 1)) + min; } 阅读全文
posted @ 2021-07-08 14:15 头牌彭鱼宴、 阅读(81) 评论(0) 推荐(0)
摘要:1、不以 "hello" 开头 /^(?!hello.*)/ 2、不以 "(hello)" 开头 /^(?![\(\(]hello[\)\)]).*/ 注:^是字符串开头,(?! ) 是正向否定预查,简单说,以 xxx(?!pattern)为例,就是捕获不以pattern结尾的内容xxx php 去 阅读全文
posted @ 2020-12-15 14:47 头牌彭鱼宴、 阅读(101) 评论(0) 推荐(0)
摘要:let canvas = document.createElement("canvas"); let img = document.getElementById('img'); canvas.width = img.width; canvas.height = img.height; let ctx 阅读全文
posted @ 2020-09-02 15:58 头牌彭鱼宴、 阅读(110) 评论(0) 推荐(0)