브라우저
![[JS] 접속한 브라우저 체크하기](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbCEF6t%2Fbtsd0vzHM0l%2FxBfzRnt5bMk354cPuXim51%2Fimg.png)
[JS] 접속한 브라우저 체크하기
예시코드 See the Pen Untitled by hyukson (@hyukson) on CodePen. 전체 코드 function getBrowser() { const browsers = [ 'Chrome', 'Opera', 'WebTV', 'Whale', 'Beonex', 'Chimera', 'NetPositive', 'Phoenix', 'Firefox', 'Safari', 'SkipStone', 'Netscape', 'Mozilla', ]; const userAgent = window.navigator.userAgent.toLowerCase(); if (userAgent.includes("edg")) { return "Edge"; } if (userAgent.includes("trident") |..
![[JS] 브라우저 크기 변경에 반응하는 이벤트](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FLEIpU%2FbtrGEmnj563%2Fydlpu4escQ9Zb8xdIlq78K%2Fimg.png)
[JS] 브라우저 크기 변경에 반응하는 이벤트
브라우저 창의 크기 변화에 반응하는 resize 이벤트를 사용하여, 변경된 브라우저 창의 크기를 가져올 수 있습니다. addEventListener 함수를 이용하여 이벤트를 지정하거나, window.onresize 함수를 통해 이벤트를 지정할 수 있습니다. // 1. window.addEventListener(`resize`, function() { }); // 2. window.onresize = function() { } 변경된 사이즈 가져오기 window.onresize = function() { const width = window.innerWidth; const height = window.innerHeight; console.log(width); console.log(height); } 윈도우..