Skip to Content
처음부터 제대로 배우는 스프링 부트
book

처음부터 제대로 배우는 스프링 부트

by 마크 헤클러, 오시영, 서정대
May 2023
Beginner to intermediate
384 pages
8h 42m
Korean
Hanbit Media, Inc.
Content preview from 처음부터 제대로 배우는 스프링 부트
199
7
스프링 MVC로 만드는 애플리케이션
: arrAC[i]
text + = "Aircraft" + ac + "\n\n";
}
document.getElementById("positions").innerText = text;
};
socket.onclose = function () {
console.log('WebSocket connection closed, hasta la próxima!');
};
</script>
</head>
<body>
<h1>Current Aircraft Positions</h1>
<div style= "border-style: solid; border-width: 2px; margin-top: 15px;
margin-bottom: 15px; margin-left: 15px; margin-right: 15px;">
<label id = "positions"></label>
</div>
</body>
</html>
코드를 더 짧게 줄일 수도 있습니다.
socket.onopen
socket.onclose
는 생략 가능한 로깅 함수이고,
socket.onmessage
는 자
바스크립트를 잘 다룬다면 더 짧게 리팩터링될 함수입니다. 다음이 이 코드의 핵심입니다.
하단의
HTML
에서 정의된
division
label
웹소켓 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

프로그래머의 길 멘토에게 묻다

프로그래머의 길 멘토에게 묻다

David Hoover, Adewale Oshineye, Kang Jung Bin
SRE를 위한 시스템 설계와 구축

SRE를 위한 시스템 설계와 구축

헤더 애드킨스, 벳시 바이어, 폴 블랭킨십, 피오트르 레반도프스키, 애나 오프레아, 애덤 스터블필드

Publisher Resources

ISBN: 9791169210966