js
千军辟易
沉迷是一种力量,让人在快乐中进步
展开
-
实现本页面跳转的几种方式
html头添加代码<meta http-equiv="refresh" content="3; url=http://www.baidu.com/" />js实现一、最外层top跳转页面,适合用于iframe框架集top.window.location.href("http://www.baidu.com");二、window.location.href和window.location.replace的区别 1.window.location.href=“url”:转载 2020-06-19 10:47:22 · 919 阅读 · 0 评论 -
【JS杂记1】获取月份最后一天,获取到每月的第一天和最后一天,获取到每个月有几周,并且每周一和周日是哪天
js 获取月份最后一天//使用new Date(year,month,0)的方式,可以获取该月的最后一天var lastDay= new Date(2020,5,0).getDate() //31// 获取到每月的第一天和最后一天getMonthFirstOrLaseDay (month) { month = month || new Date().getMonth() // 设置默认 如果不穿 取当前月份 var nowdays = new Date() var year = n...原创 2020-06-09 00:06:13 · 369 阅读 · 0 评论