摘要:
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 </head> 7 <body> 8 <script type="text/javascript"> 9 // 根据对象某个属性的值来获取 阅读全文
摘要:
1 let width = document.body.clientWidth //浏览器宽度 2 let height= document.body.clientHeight //浏览器高度 3 4 //电脑分辨率 5 let cHeight = screen.height 6 let cWidt 阅读全文
摘要:
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8" /> 5 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> 6 <!-- 引入样 阅读全文
摘要:
1 <!-- 首先将jquery和layer.js放在index.html中 --> 2 <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script> 3 <script src="static/la 阅读全文
摘要:
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 <!-- jquery需要v1.8以上 --> 7 <script src="https://cdn.bootcdn.net/ajax/l 阅读全文
摘要:
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>监听浏览器的宽高变化</title> 5 </head> 6 <body style="width: 1440px;height: 1000px;"> 7 <div id="div"></div> 8 <scr 阅读全文
摘要:
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 </head> 7 <body> 8 <script type="text/javascript"> 9 console.log(scre 阅读全文
摘要:
1 let {keys, values, entries} = Object 2 let a = { 3 "b":'1', 4 "c":'2', 5 "d":'3' 6 } 7 for (let s of keys(a)) { 8 // b c d 9 console.log(s) 10 } 11 阅读全文
摘要:
1 // 扩展运算符(...) 2 let a = [1,2,3,4] 3 let b = [5,6,7,8] 4 let c = [9,10,11,12] 5 let d = '1'+'2'+'3' 6 // 将数组转为一个参数序列 7 console.log(...a) 8 // 将b添加在a的 阅读全文
摘要:
1 // 尾部调用 2 function f (x) { 3 console.log('这是函数f:'+ x) 4 return g(x) 5 } 6 function g (a) { 7 console.log('这是函数g:'+ a) 8 } 9 f(10) 10 // 尾递归:不会出现栈溢出现 阅读全文