![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
meishaonvhahaha
这个作者很懒,什么都没留下…
展开
-
利用setTimeout和clearTimeout封装setInterval和clearInterval
方法一: function SetInterval(fun, sec){ function recFun(){ fun(); this.id = setTimeout(recFun, sec);//将任务的标识符记录在timer对象中 } this.stop = function(){ clearTimeout(this.id);//取消下一个任务的执行 } this.start = function(){ ...原创 2021-07-12 11:38:01 · 201 阅读 · 0 评论 -
原型,原型链以及6种继承
// =====================原型 function Person() { } var person = new Person(); console.log(person.__proto__ == Person.prototype) // true console.log(Person.prototype.constructor == Person) // true // 顺便学习一个ES5的方法,可以获得对象的原型 console.log(Object.g...原创 2020-06-15 16:23:39 · 416 阅读 · 0 评论 -
location方法总结
window.location方法获取URL 完整的URL由这几个部分构成: scheme://host:port/path?query#fragment scheme:通信协议 常用的http,ftp,smtp等 host:主机(带端口号) 服务器(计算机)域名系统 (DNS) 主机名或 IP 地址。 port:端口号 整数,可选,省略时使用方案的默认端口,如...原创 2019-05-07 13:38:02 · 2844 阅读 · 0 评论