Back to feed
Renewal·서른의 생활코딩

Sample source 3) JavaScript basic document structure ( screen object )

NS
normalstory
cover image

This time, there is JavaScript code that checks the monitor environment used by the user or developer, 
so let's look at the code that allows you to check those things. 

Why do we even need to do something like this?

Let's think about it this way

If, depending on whether the user is viewing on a 30-inch monitor, a 17-inch, a 7-inch, or a smartphone,
you want to compose a screen or service optimized for each.

" And the screen figures it out by itself. "  
(= which is possible because, as I rambled on earlier, this is a non-object-oriented based language ! )
In truth,
in practice, different methods are used for N-screen,
but my personal opinion is that having the experience and idea that you can also apply it this way will surely be helpful later.


" Not just for programming, but to develop the problem-solving ability to live life. "



<!DOCTYPE html>


<html>


<head>


<meta charset="utf-8" />


<title>screen객체</title>


<script type="text/javascript">


//<![CDATA[




document.write("화면전체 height :" +screen.height + "<br />");


document.write("화면전체 width :" +screen.width + "<br />");




document.write("사용가능한 화면전체 height :" +screen.height + "<br />");


document.write("사용가능한 화면전체 width :" +screen.width + "<br />");




document.write("화면색상수 :" +screen.colorDepth + "<br />");


document.write("픽셀당 화면 해상도 :" +screen.pixelDepth + "<br />");




document.write("사용가능한 x축좌표 :" +screen.availLeft + "<br />");


document.write("사용가능한 y축좌표 :" +screen.availTop + "<br />");




//]]]]>


</script>


</head>




<body>




</body>


</html>





This English version was translated by Claude.

친절한 찰쓰씨
Written by
친절한 찰쓰씨

Pleasant Charles — UI/UX researcher at AIT. Keeping notes on design, planning, and slow days here since 2010.

More on the author's page

Keep reading

Renewal

Steadily, for the long haul, without burning out

Mar 31, 2026·9 min
Renewal

Tech-life balance

Feb 7, 2026·3 min
Renewal

Humanality, by Park Jeong-ryeol

Feb 7, 2026·11 min