Skip to content

Commit 9662fae

Browse files
committed
整理
1 parent bee295b commit 9662fae

20 files changed

Lines changed: 162 additions & 262 deletions
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Title</title>
6+
</head>
7+
<body>
8+
<div>
9+
<p>编辑器:webstorm/vscode</p>
10+
<p>浏览器:chrome</p>
11+
</div>
12+
<script>
13+
console.log('现在可以写JS代码了')
14+
</script>
15+
</body>
16+
</html>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
console.log("22");//string 字符串
2+
console.log(22);//number 数字类型
3+
console.log(true);//boolean 布尔 英文考试了 T / F
4+
5+
console.log(undefined);
6+
console.log(null);
7+
console.log({});
8+
console.log(function () {});
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// 数据类型的判断
2+
console.log("-------下面是typeof判断");
3+
console.log(typeof "22");//string 字符串
4+
console.log(typeof 22);//number 数字类型
5+
console.log(typeof true);//boolean 布尔 英文考试了 T / F
6+
7+
console.log(typeof undefined);//undefined
8+
console.log(typeof null);//Object
9+
console.log(typeof {});//Object
10+
console.log(typeof function () {});//function
11+
12+
// 区别
13+
console.log("-------下面是区别");
14+
console.log(typeof "undefined");//string 字符串
15+
console.log(typeof "true"); //string 字符串
16+
console.log(typeof "null"); //string 字符串
17+
console.log(typeof "{}"); //string 字符串
18+
console.log(typeof "function () {}");//string 字符串
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//变量的类型改变
2+
var china="中国";//string类型里的一个份子,
3+
console.log(china,typeof china);
4+
5+
china=22;
6+
console.log(china,typeof china);
7+
8+
china=true;
9+
console.log(china,typeof china);
10+
11+
china=22;
12+
console.log(china,typeof china);
13+
14+
console.log(china,typeof china);
15+
16+
console.log(china,typeof china);
17+
18+
console.log(china,typeof china);
19+
20+
console.log(china,typeof china);
21+
22+
23+
//不推荐一个变量,用于多种用途;
24+
var total=0; //用来储存金额统计;
25+
var timer=null; //用来储存定时器

前端开发初识/13.console.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
console.time("hahaha");
2+
// alert("22222");
3+
console.log("info","haha");
4+
console.log("info2"+"haha2");
5+
6+
console.warn("这是一段警告信息");
7+
console.error("出错啦,你的配置信息有误");
8+
9+
// alert(typeof "22");
10+
11+
// 断言
12+
13+
var a=1;
14+
var b=2;
15+
//= ==
16+
//= 这是用来赋值的;
17+
//== 这个是用来判断的
18+
console.assert(a===1,"这时候条件是a==1,实际a是1");
19+
console.assert(b===1,"这时候条件是b==1,实际b是2");
20+
21+
//性能分析;
22+
console.timeEnd("hahaha");//6.50390625ms
23+
24+
// console.dir(window);
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
.div-class{
1111
color: red;
1212
}
13-
.div2{
13+
#div2{
1414
background-color: red;
1515
}
1616
#div2{
@@ -25,7 +25,7 @@
2525
<div class="div-class">5</div>
2626
<div class="div-class">5</div>
2727

28-
<p>22222>
28+
<p>22222</p>
2929
<p>22222</p>
3030
<div id='div1' title="这是title by div">这是DIV1的内容</div>
3131
<div id="div2">222</div>
@@ -46,8 +46,6 @@
4646
oDiv2.style.color="red";//通过JS来改变CSS;
4747
console.log("ID",oDiv1);
4848

49-
50-
5149
var oDivClass=document.getElementsByClassName("div-class");//这是一对标签的集合
5250
console.log(oDivClass);
5351
console.log(oDivClass[0]);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
body .test-demo{ color: orange; }
3030

3131
</style>
32-
<!--外链的写法-->\
32+
<!--外链的写法-->
3333
<!--<style src="./wui/color.css?t=201708261529"></style>-->
3434
<link rel="stylesheet" href="./wui/color.css?t=201708261529">
3535

0 commit comments

Comments
 (0)