forked from anbang/javascript-notes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-file.html
More file actions
31 lines (31 loc) · 789 Bytes
/
test-file.html
File metadata and controls
31 lines (31 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<p><b>hello </b>word!</p>
<script src="index.js"></script>
<!--<script>
function Person(name,age,job){
if(this instanceof Person){
console.log("Person用法 - 正确");
this.name=name;
this.age=age;
this.job=job;
}else{
console.log("Person用法 - 不正确");
return new Person(name,age,job);
}
}
var person=Person("hahahah",26,"WEB");
console.log(person);
console.log(person.name);//"hahahah";
console.log(window.name);//""
console.log(typeof window.name);//string
console.log(window.age);//26;
console.log(window.job);//WEB";
</script>-->
</body>
</html>