Skip to content

Commit 9d94cc1

Browse files
authored
Add files via upload
update java8 code
1 parent e1152f9 commit 9d94cc1

File tree

7 files changed

+248
-0
lines changed

7 files changed

+248
-0
lines changed

jquery/W3C/对象/index.html

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>对象创建</title>
6+
</head>
7+
<body>
8+
<script>
9+
person = new Object();
10+
person.firstName = 'Bill';
11+
person.lastName = 'Gates';
12+
person.age = 56;
13+
person.eyecolor = 'blue';
14+
document.write(person.firstName + " is " + person.age + " years old. ");
15+
</script>
16+
<br/>
17+
<script>
18+
person = {firstName: "Bill", lastName: "Gates", age: 56, eyecolor: "blue"}
19+
document.write(person.firstName + " is " + person.age + " years old.");
20+
21+
</script>
22+
23+
<br/>
24+
<!--构造器方式-->
25+
<script type="text/javascript">
26+
27+
function person(firstName, lastName, age, eyecolor) {
28+
this.firstName = firstName;
29+
this.lastName = lastName;
30+
this.age = age;
31+
this.eyecolor = eyecolor;
32+
}
33+
you = new person("Bill", "Gates", 56, "blue");
34+
document.write(you.firstName + " is " + you.age + " years old.")
35+
</script>
36+
37+
<br/>
38+
<!--属性添加-->
39+
<script>
40+
function person(firstName, lastName, age, eyecolor) {
41+
this.firstName = firstName;
42+
this.lastName = lastName;
43+
this.age = age;
44+
this.eyecolor = eyecolor;
45+
this.changeName = changeName;
46+
function changeName(name) {
47+
this.lastName = name;
48+
}
49+
}
50+
me = new person("Bill", "Gates", 18, "blue");
51+
me.changeName("Are you ok?");
52+
document.write(me.lastName);
53+
54+
</script>
55+
56+
</body>
57+
</html>

jquery/W3C/对象/index2.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>对象循环遍历</title>
6+
</head>
7+
<body>
8+
<p>循环遍历对象数据</p>
9+
<button type="button" onclick="myfunction()">有种你就点击!</button>
10+
<p id="demo"></p>
11+
<script>
12+
function myfunction() {
13+
var x;
14+
var txt = "";
15+
person = {firstName: "Bill", lastName: "Gates", age: 18};
16+
for (x in person) {
17+
txt = txt + " " + person[x];
18+
}
19+
document.getElementById('demo').innerText = txt;
20+
}
21+
22+
</script>
23+
</body>
24+
</html>

jquery/W3C/对象/index3.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Title</title>
6+
</head>
7+
<body>
8+
<script>
9+
var x;
10+
document.write("<p>x只有17位")
11+
x = 12345678901234567890;
12+
document.write(x + "</p>")
13+
document.write("<p>0.2+0.1=");
14+
x = 0.2 + 0.1;
15+
document.write(x + "</p>")
16+
document.write("<p>可分别乘以 10 并除以 10 : ");
17+
x = (0.2 * 10 + 0.1 * 10) / 10;
18+
document.write(x + "<p>");
19+
20+
</script>
21+
22+
</body>
23+
</html>

jquery/W3C/对象/index4.html

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>字符串</title>
6+
</head>
7+
<body>
8+
<script>
9+
var txt = "Hello world!";
10+
document.write(txt.length);
11+
12+
document.write(txt.toUpperCase())
13+
</script>
14+
<br/>
15+
<script type="text/javascript">
16+
var myDate = new Date();
17+
myDate.setFullYear(2018, 1, 30);
18+
document.write(myDate);
19+
document.write("<br/>")
20+
var today = new Date();
21+
today.setDate(today.getDate() + 5);
22+
document.write(today);
23+
</script>
24+
<br/>
25+
<script>
26+
var myDate = new Date();
27+
myDate.setFullYear(2018, 1, 29);
28+
var today = new Date();
29+
if (myDate > today) {
30+
alert("大于当前时间!");
31+
} else {
32+
alert("小于当前时间!")
33+
}
34+
35+
</script>
36+
37+
38+
</body>
39+
</html>

jquery/W3C/对象/index5.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>数组</title>
6+
</head>
7+
<body>
8+
<script>
9+
var arr = new Array();
10+
arr[0] = "A";
11+
arr[1] = "B";
12+
arr[2] = "C";
13+
14+
var arrs = new Array(3);
15+
arrs[0] = "A";
16+
arrs[1] = "B";
17+
arrs[2] = "C";
18+
var mycars = new Array("A", "B", "C");
19+
document.write(mycars[0]);
20+
mycars[0] = "Aa";
21+
document.write("<br/>")
22+
document.write(mycars[0]);
23+
24+
25+
</script>
26+
27+
</body>
28+
</html>

jquery/W3C/对象/index6.html

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>逻辑判断</title>
6+
</head>
7+
<body>
8+
<script>
9+
var myboolean = new Boolean();
10+
document.write(myboolean);
11+
document.write("<br/>");
12+
13+
var myboolean2 = new Boolean("");
14+
document.write(myboolean2);
15+
document.write("<br/>");
16+
17+
var myboolean3 = new Boolean(null);
18+
document.write(myboolean3);
19+
document.write("<br/>");
20+
21+
var myboolean4 = new Boolean(false);
22+
document.write(myboolean4);
23+
document.write("<br/>");
24+
25+
var myboolean5 = new Boolean(NaN);
26+
document.write(myboolean5);
27+
document.write("<br/>");
28+
29+
var myboolean6 = new Boolean(0);
30+
document.write(myboolean6);
31+
document.write("<br/>");
32+
</script>
33+
<script>
34+
var bool = new Boolean(1);
35+
document.write(bool);
36+
document.write("<br/>");
37+
38+
var bool2 = new Boolean(true);
39+
document.write(bool2);
40+
document.write("<br/>");
41+
42+
var bool3 = new Boolean("true");
43+
document.write(bool3);
44+
document.write("<br/>");
45+
46+
var bool4 = new Boolean("false");
47+
document.write(bool4);
48+
document.write("<br/>");
49+
50+
var bool5 = new Boolean("Bill Gates");
51+
document.write(bool5);
52+
document.write("<br/>");
53+
54+
55+
</script>
56+
57+
58+
</body>
59+
</html>

jquery/W3C/对象/index7.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Title</title>
6+
</head>
7+
<body>
8+
<script>
9+
document.write(Math.round(4.7));
10+
document.write("<br/>");
11+
document.write(Math.random());
12+
document.write("<br/>")
13+
document.write(Math.floor(Math.random() * 11));
14+
15+
</script>
16+
17+
</body>
18+
</html>

0 commit comments

Comments
 (0)