location 객체
- 윈도우에 로드된 웹 페이지의 URL 정보를 나타내는 객체
- location 객체로 현재 윈도우에 웹 페이지 열기
- 새 윈도우에 웹 페이지 열기
- location 객체의 프로퍼티와 URL의 구성 요소와의 관계
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
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
function load(){
sel = document.getElementById("site");
window.location = sel.options[sel.selectedIndex].value;
}
</script>
</head>
<body>
<h3>window.location으로 select 웹 사이트 이동</h3><hr>
사이트 선택 :
<select id="site">
</select>
<button onclick="load()">웹 사이트 접속</button><p>
<select id="site1" onchange="load()">
</select><p>
</body>
</html>
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
'화면구현' 카테고리의 다른 글
history 객체 (0) | 2020.03.16 |
---|---|
웹 페이지 스크롤 (0) | 2020.03.16 |
window 객체의 타이머 활용 (0) | 2020.03.16 |
윈도우 열기 (0) | 2020.03.16 |
계산기 만들기 (0) | 2020.03.12 |