![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
从此花海一片
这个作者很懒,什么都没留下…
展开
-
hbuilderX 的使用
uni-app 学习记录原创 2023-07-10 22:52:15 · 1044 阅读 · 0 评论 -
IE 零碎知识点
1 IE 设置指定日期时,日期格式必须是xxxx/xx/xx hh:mm:ss,以 / 隔开,否则获取的是无效日期 let startDate = '2021-02-23 10:01:45' startDate = startDate.replace(/-/g, '/') // 2021/02/23 10:01:45 let setTime = new Date(startDate); let nowTime = new Date(); let原创 2021-02-23 10:02:47 · 112 阅读 · 0 评论 -
倒计时
//计算倒计时function calculatePayTime(endTime){ let countTime = '' let setTime = new Date(endTime); let nowTime = new Date(); let restSec = setTime.getTime() - nowTime.getTime(); if(restSec > 0){ let day = parseInt(restSec / (3600 * 24 * 1000)原创 2020-07-25 17:36:07 · 94 阅读 · 0 评论 -
时间处理方法
直接通过new Date出来的时间不符合我们的习惯,node.js中的dateformar插件可以对时间经常处理,使用 方式如下1 下载dateformat插件 npm install dateformat2 在js中引入dateformat模块3 导入模块变量const template=require('art-template');const path=require('path...原创 2019-10-07 13:44:00 · 618 阅读 · 1 评论 -
js中事件注册书写的三种位置
1 行内注册事件1.1 在行内直接写函数 <div class="box" onclick="{alert(245)}"><div>1.2 或者在行内调用已经写好的函数<div class="box" onclick="fun()"><div><script> function fun(){ alert(23...原创 2019-09-22 09:55:56 · 145 阅读 · 0 评论 -
箭头函数中的this和ES6之前函数中的this指向对比
1 ES6中this的指向是向外层寻找离自己最近的this指向。在不改变this指向时,箭头函数中this有两种情况1 this 指向被注册的元素<script> var btn=document.querySelector(button); btn.onclick=function(){ console.log(this);//this 指...原创 2019-09-23 19:47:09 · 108 阅读 · 0 评论 -
Object.prototype.toString判断任意的数据类型
在JavaScript里使用typeof判断数据类型,只能区分基本类型,即:number、string、undefined、boolean、object、function。对于null、array、object来说,使用typeof都会统一返回object字符串。要想区分对象、数组、函数、单纯使用typeof是不行的。在JS中,可以通过Object.prototype.toString方法,判...原创 2019-12-13 22:11:56 · 312 阅读 · 0 评论