. availHeight // 작업 표시줄 등을 제외하고 브라우저가 출력 가능한 영역의 높이
. availWidth // 작업 표시줄 등을 제되하고 브라우저가 출력가능한 영역의 폭
. pixelDepth // 한 픽셀의 색을 나타내기 위해 사용되는 비트 수 . colorDepth // 한 픽셀의 색을 나타내기 위해 사용되는 비트 수로서 pixelDepth 와 동일 . 대부분의 브라우저에서 지원되므로 pixelDepth 보다 colorDepth 를 사용 할 것을 권함
. availHeight // 스크린의 수직 픽셀 수 . width // 스크린의 수평 픽셀 수
<title>스크린에 관한 정보 출력</title>
<script>
function printScreen(){
var text = "avaiHeight : "+screen.availHeight + "<br>";
text += "avaiWidth : "+ screen.availWidth + "<br>";
text += "colorDepth : "+ screen.colorDepth + "<br>";
text += "pixelDepth : "+ screen.pixelDepth + "<br>";
text += "height : "+ screen.height + "<br>";
text += "width : "+ screen.width + "<br>";
document.getElementById("div").innerHTML = text;
}
</script>
</head>
<body onload="printScreen()">
<h3>스크린 장치에 관한 정보</h3>
<hr>
<div id="div"></div>
</body>
위코드를 실행한 결과
. history 객체
history 객체는 사용자가 방문한 웹 페이지의 리스트, 즉 히스토리 정보를 담고 있는 객체로 다음과 같이 접근한다.
window.history 혹은 history
. history.back(); 또는 history.go(-1); // 이전 페이지로 이동 . history.forward(); 또는 history.go(1); // 다음 페이지로 이동
.history 객체의 프로퍼티와 메서드
프로퍼티
.length // 히스토리 리스트에 있는 엔트리 수
메서드 .back() // 히스토리에 있는 이전 웹 페이지로 이동. 브라우저 <back> 버튼과 동일 .forward() // 히스토리에 있는 다음 웹 페이지로 이동. 브라우저의 <forward> 버튼과 동일 .go(n) // 히스토리에서 현재 웹페이지에서 n 만큼 상대적인 웹페이지로 이동
<title>history 객체</title>
<script>
document.write("방문한 페이지 수 : "+hitory.length);
</script>
</head>
<body>
<h3>history 객체 연습 ( 첫 번째 페이지)</h3>
<a href="test1.html">다음 페이지</a><br><Br>
<input type="button" value="이전으로11" onclick="javascript:history.back()">
<input type="button" value="다음으로11" onclick="history.forward()">
<input type="button" value="처음으로11" onclick="history.go(-2)">
</body>