随笔分类 - javascript
摘要:错误的日期格式{ "condition": { "startTime": "2019-11-6 00:00:00", "endTime": "2019-11-7 00:00:00" }, "pageSize": 100, "pageNum": 1 } 正确的日期格式 如果日期是1-9号,则前面需要加上0 { "condition": { "start...
阅读全文
摘要:解构赋值 https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment 展开语法 https://developer.mozilla.org/zh-CN/doc
阅读全文
摘要:Array.prototype.filter = Array.prototype.filter || function(func) { var arr = this; var r = []; for (var i = 0; i < arr.length; i++) { if (func(arr[i])) { r.push(arr[i...
阅读全文
摘要:// 添加var container = document.getElementById('divAudio');container.appendChild(audio);// 删除var container = document.getElementById('divAudio'); if (container.firstChild !== null) { console.log('...
阅读全文
摘要:https://blog.csdn.net/qq_37815596/article/details/80902516?utm_source=blogxgwz2
阅读全文
摘要:1 这个信息比较多 https://api.ipdata.co/?api-key=test 2 这个信息稍微少一些,但可以直接获取用户的IP等信息也可以查询指定的IP地址的信息 https://geoiplookup.io/api
阅读全文
摘要:var e = new Date(); var endOfMonth = new Date(e.getFullYear(), e.getMonth() + 1, 0);
阅读全文
摘要:// 方法1 原型Date.prototype.format = function (format) { var o = { "M+": this.getMonth() + 1, //month "d+": this.getDate(), //day "h+": this.getHours(), //hour "m+...
阅读全文
摘要:http://www.jb51.net/article/21191.htm js 读本地文件 Load
阅读全文
摘要://[捕捉所有前端error] window.onerror = function (errormessage, url, line, column, error) { console.log("======================================================================") console....
阅读全文
摘要:原文: http://www.jb51.net/article/41124.htm onMouseDown 按下鼠标时触发 onMouseOver 鼠标经过时触发 onMouseUp 按下鼠标松开鼠标时触发 onMouseOut 鼠标移出时触发 onMouseMove 鼠标移动时触
阅读全文
摘要:<script type="text/javascript">document.write('这里是内容');</script>
阅读全文
摘要:// numberMillis 毫秒 function sleep(numberMillis) { var now = new Date(); var exitTime = now.getTime() + numberMillis; while (true) { now = new Date(); if (now.getTime() > exitTime...
阅读全文
摘要:转自 :http://blog.csdn.net/jyy_12/article/details/6878049
阅读全文
摘要:function test(s){ alert(s);}window.setTimeout(function(){test('str');},1000);这样就可以了...为什么是这样呢.因为setTimeout要求的第一个参数是函数...比如setTimeout(a_fun,1000)这样是可以的
阅读全文
摘要:转自:http://m.blog.csdn.net/article/details?id=40300873
阅读全文
摘要://日期加天数的方法 //dataStr日期字符串 //dayCount 要增加的天数 //return 增加n天后的日期字符串 function dateAddDays(dataStr,dayCount) { var strdate=dataStr; //日期字符串 var isdate = new Date(strdate.replace(/-/g,"/")); //把日期字符串转换成...
阅读全文
摘要:转换成:2016-07-11 function getFDate(date) { var d = eval('new ' + date.substr(1, date.length - 2)); var ar_date = [d.getFullYear(), d.getMonth() + 1, d.g
阅读全文
摘要:JS正则表达式验证账号、手机号、电话和邮箱效果体验:http://keleyi.com/keleyi/phtml/jstexiao/15.htm验证帐号是否合法验证规则:字母、数字、下划线组成,字母开头,4-16位。function checkUser(str){ var re = /^[a-...
阅读全文
摘要:[]是数组形式,{}是对象形式,都可以包含其他类型.如var a= ["A","B",{a:1,b:2}];a[1] 取得的是B,a[2].b取得的是2;var s = {a:1,b:["A","B"]}s.a取得的是1,s.b[1]取得的是A
阅读全文
浙公网安备 33010602011771号