Skip to content

Commit 3d6da6a

Browse files
authored
BOM
1 parent e98ce0d commit 3d6da6a

9 files changed

Lines changed: 177 additions & 0 deletions

File tree

0804/aa.jpg

801 KB
Loading

0804/ex01.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
<script>
11+
document.write('hello world <br />');
12+
window.document.write('hello <br>');
13+
document.write('브라우저의 모든 객체는 window의 프로퍼티')
14+
</script>
15+
</body>
16+
</html>

0804/ex02.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+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>user communication</title>
8+
</head>
9+
<body>
10+
<script>
11+
alert('hello world');
12+
document.write('확인을 눌러야만 작동됨<br>')
13+
14+
15+
if(confirm('ok?')){
16+
document.write('true<br>');
17+
} else {
18+
document.write('false<br>');
19+
}
20+
21+
document.write(prompt())
22+
</script>
23+
</body>
24+
</html>

0804/ex03.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
<script>
11+
document.write(location + '<br>')
12+
document.write(location.toString() +'<br>'); // 현재 사이트의 주소
13+
document.write(location.protocol + '<br>'); // http https ftp 등
14+
document.write(location.host + '<br>'); // 컴퓨터 주소
15+
document.write(location.port + '<br>');
16+
document.write(location.pathname + '<br>');
17+
document.write(location.search + '<br>');
18+
document.write(location.bookmark + '<br>');
19+
document.write('protocol://host:port/pathname?search#hash');
20+
</script>
21+
<input type="button" value="don't click" onclick="
22+
location.href = 'https://google.com';
23+
">
24+
25+
</body>
26+
</html>

0804/ex04.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
<script>
11+
document.write(navigator.appName + '<br>');
12+
document.write(navigator.appVersion + '<br>');
13+
document.write(navigator.userAgent + '<br>');
14+
document.write(navigator.platform + '<br>');
15+
// document.write(navigator);
16+
// document.write(navigator);
17+
// document.write(navigator);
18+
// document.write(navigator);
19+
</script>
20+
</body>
21+
</html>

0804/ex05.html

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<style>li {padding:10px; list-style: none}</style>
4+
<body>
5+
<ul>
6+
<li>
7+
첫번째 인자는 새 창에 로드할 문서의 URL이다. 인자를 생략하면 이름이 붙지 않은 새 창이 만들어진다.<br />
8+
<input type="button" onclick="open1()" value="window.open('demo2.html');" />
9+
</li>
10+
<li>
11+
두번째 인자는 새 창의 이름이다. _self는 스크립트가 실행되는 창을 의미한다.<br />
12+
<input type="button" onclick="open2()" value="window.open('demo2.html', '_self');" />
13+
</li>
14+
<li>
15+
_blank는 새 창을 의미한다. <br />
16+
<input type="button" onclick="open3()" value="window.open('demo2.html', '_blank');" />
17+
</li>
18+
<li>
19+
창에 이름을 붙일 수 있다. open을 재실행 했을 때 동일한 이름의 창이 있다면 그곳으로 문서가 로드된다.<br />
20+
<input type="button" onclick="open4()" value="window.open('demo2.html', 'ot');" />
21+
</li>
22+
<li>
23+
세번재 인자는 새 창의 모양과 관련된 속성이 온다.<br />
24+
<input type="button" onclick="open5()" value="window.open('demo2.html', '_blank', 'width=200, height=200, resizable=yes');" />
25+
</li>
26+
</ul>
27+
28+
<script>
29+
function open1(){
30+
window.open('test.html');
31+
}
32+
function open2(){
33+
window.open('test.html', '_self');
34+
}
35+
function open3(){
36+
window.open('test.html', '_blank');
37+
}
38+
function open4(){
39+
window.open('test.html', 'ot');
40+
}
41+
function open5(){
42+
window.open('test.html', '_blank', 'width=200, height=200, resizable=no'); //resizable은 요즘 지원하지 않는다.
43+
}
44+
</script>
45+
</body>
46+
</html>

0804/ex06.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
ㅠㅠ
11+
</body>
12+
</html>

0804/ex07.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
<script>
11+
// window.open('test.html', 'abc'); // 허용이 안돼야 하는데
12+
</script>
13+
<input type="button" value="누르지 마시오" onclick="
14+
window.open('test.html');
15+
">
16+
<input type="button" value="누르시오" onclick="
17+
window.close('test.html');
18+
">
19+
</body>
20+
</html>

0804/test.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
<img src="//file.namu.moe/file/c2790d5985eae82cd1199a4cba2101c14bdc43ac45adbdc96efcc626fa1360903d5a10df08f24af7db009525a099668f87bc1d4a76c6ad5397a8768b46b1f2c0">
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)