上一页 1 2 3 4 5 6 7 8 9 ··· 13 下一页
摘要: 阅读全文
posted @ 2021-05-29 16:48 starlog 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 一、基础/原始类型(primitive type): number、string、boolean、undefined、null、symbol 二、合成/引用类型(complex type): object(plain object、array、function ) 阅读全文
posted @ 2021-05-29 16:35 starlog 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 一、块状元素(display: block/table,特点是独占一行): div、p、h1、table、form、ul、ol、dl 二、内联元素(display: inline/inline-block,特点是不会独占一行,会挨着往后排,直到浏览器的边缘换行为止): span、a、input、te 阅读全文
posted @ 2021-05-29 16:22 starlog 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 一、<style>标签: 1.答案:<style>标签应该放在<head>标签里面。 2.原因:因为浏览器解析HTML文档是自上而下的,这样<style>标签里的样式就会作用到body里的元素上。如果<style>标签写在<body>标签下面,在这之前的元素的样式就不会生效,会导致页面结构出来了,而 阅读全文
posted @ 2021-05-28 18:51 starlog 阅读(3706) 评论(0) 推荐(1) 编辑
摘要: 一、XMLHttpRequest: 1.get请求与post请求: // get请求 const xhr = new XMLHttpRequest() xhr.open('GET', '/data/test.json', true) xhr.onreadystatechange = function 阅读全文
posted @ 2021-05-12 17:49 starlog 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 一、 事件绑定: 获取触发的元素:event.target 阻止默认行为:event.preventDefault() 二、事件冒泡: 1.事件冒泡的流程: (1)基于DOM树形结构 (2)事件会顺着触发的元素往父元素冒泡 (3)事件冒泡的应用场景:事件代理,它基于事件冒泡 2.阻止往上冒泡:eve 阅读全文
posted @ 2021-05-11 18:47 starlog 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 一、navigator(浏览器)和screen(屏幕): 1.navigator.userAgent:当前浏览器信息 2.screen.width:屏幕宽度 3.screen.height:屏幕高度 二、location(地址)和history(前进、后退): 1.location.href:整个网 阅读全文
posted @ 2021-05-10 15:10 starlog 阅读(46) 评论(0) 推荐(0) 编辑
摘要: 一、DOM本质: 浏览器根据HTML文件解析出的一个树形结构 二、DOM节点操作: 1.获取DOM节点: const div1 = document.getElementById('div1') // 元素 const divList = document.getElementsByTagName( 阅读全文
posted @ 2021-05-10 11:51 starlog 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 一、什么是微任务,什么是宏任务: 1.微任务:Promise、async/await 2.宏任务:setTimeout、setInterval、Ajax、DOM事件 3.微任务比宏任务执行的更早 console.log(100) setTimeout(() => { console.log(200) 阅读全文
posted @ 2021-05-08 18:19 starlog 阅读(1015) 评论(0) 推荐(0) 编辑
摘要: for...in、forEach、for是常规的同步遍历,而for...of是常用于异步的遍历 // 定时算乘法 function multi(num) { return new Promise((resolve) => { setTimeout(() => { resolve(num * num) 阅读全文
posted @ 2021-05-08 15:07 starlog 阅读(186) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 13 下一页