摘要: http 阅读全文
posted @ 2022-09-27 08:58 吾辈皆喜黑丝 阅读(18) 评论(0) 推荐(0)
摘要: form表单 属性 action 提交的最后地点 method post,get提交方式 input 输入框 属性 type text文本 password密码 submit提交 reset重置 radio单选框 button按钮 img图片按钮 value默认值 maxlength输入的最大长度 阅读全文
posted @ 2022-09-22 22:10 吾辈皆喜黑丝 阅读(36) 评论(0) 推荐(0)
摘要: 标签 1.标题标签 <h1> 标题标签</h1> 2.段落标签 <p>段落标签</p> 3.换行标签 </br> 4.水平线标签 </hr> 5.空格 &nbsp 6.图片标签 <img>图片标签</img> src(图片存储路径) alt(图片名称) 7.链接标签 1.<a>a标签</a> hre 阅读全文
posted @ 2022-09-19 22:49 吾辈皆喜黑丝 阅读(33) 评论(0) 推荐(0)
摘要: 7.操作BOM对象 BOM:浏览器对象模型 window //弹窗 window.alert(1) //浏览器内外高度 window.innerHeight 754 window.innerWidth 1134 window.outerHeight 824 window.outerWidth 153 阅读全文
posted @ 2022-07-30 09:03 吾辈皆喜黑丝 阅读(29) 评论(0) 推荐(0)
摘要: class (es6引入) 1.定义一个类属性方法 class Student{ name; constructor() { //constructor构造器 this.name=name } hello(){ alert('hello'); } var xiaohong=new Student(" 阅读全文
posted @ 2022-07-29 20:03 吾辈皆喜黑丝 阅读(17) 评论(0) 推荐(0)
摘要: 5.2JSON对象 任何JavaScript支持的数据类型,都可以用JSON表示 对象用{ } 数组用[ ] 所有的键值对用key:value JSON字符串和对象的转化 var user={ name: "邓", age: 18, password: 12348 } var j=JSON.stri 阅读全文
posted @ 2022-07-29 10:28 吾辈皆喜黑丝 阅读(34) 评论(0) 推荐(0)
摘要: 5.1Date 标准对象类型 typeof 123 'number' typeof '123' 'string' typeof true 'boolean' typeof NAN 'undefined' typeof [] 'object' typeof {} 'object' typeof dzj 阅读全文
posted @ 2022-07-29 09:42 吾辈皆喜黑丝 阅读(36) 评论(0) 推荐(0)
摘要: 4.2变量的作用域 在javascript中定义的实际变量是有作用域的 1.在函数体内声明在函数体外不能使用(可以通过闭包实现) function dzj(){ var x=1; x=x+1; } x=x+2;//Uncaught ReferenceError: x is not defined 2 阅读全文
posted @ 2022-07-28 21:14 吾辈皆喜黑丝 阅读(78) 评论(0) 推荐(0)
摘要: 4.1定义函数 定义绝对值函数:方法一 function f(x){ if(x>=0){ return x; }if(x<0){ return -x; } } 定义绝对值函数:方法二 var f=function(x){ if(x>=0){ return x; }if(x<0){ return -x 阅读全文
posted @ 2022-07-28 17:20 吾辈皆喜黑丝 阅读(60) 评论(0) 推荐(0)
摘要: 3.6iterator迭代 for of遍历具体内容for in遍历下标 1.遍历数组 var arr=[6,5,8]; for (var x of arr){ console.log(x) } 2.遍历Map var map=new Map([['ni',6],['wo',5],['ta',8]] 阅读全文
posted @ 2022-07-28 09:04 吾辈皆喜黑丝 阅读(63) 评论(0) 推荐(0)