js(3)
-
[JS] 우클릭 인식은 어떻게 구현하는 것일까?
코드 챌린지를 하다가 이벤트리스너를 복습하고 있었는데 역시 하다보면 구멍이 슝슝 뚫려있는 곳이 많았다. 그 중 하나가 우클릭을 어떻게 구현하는 것인가였다. 구글링하면 금방 나올줄 알았는데 안나오고 다들 클릭 이벤트 종류에 대해서만 다뤄서 이 글을 남긴다. 역시 검색은 영어로 찾아야한다; const superEventHandler = { mouseOver: function () { hello.innerText = "The mouse is here!"; hello.style.color = colors[0]; }, mouseOut: function () { hello.innerText = "The mouse is gone!"; hello.style.color = colors[1]; }, reSized: fun..
2023.03.23 -
[JS] PingPongScoreKeeper 만들며 몰랐던 점
1. HTML - bulma에 대해 새롭게 배웠다. > 부트스트랩봐 표현법이 더 직관적이어서 좋았다. Ping Pong Score Keeper 0 to 0 Use the buttons below to keep score Playing to 3 4 5 6 7 8 9 10 11 +1 Player One +2 Player Two Reset 2. JS - innerHTML, innerText, textContent의 차이를 몰랐다. > innerText의 경우 불필요한 공백은 제거하고 브라우저 상에 출력되는 값을 그대로 가져온다. 만약 html 상 입력은 되었는데 브라우저의 display:none;으로 보여지지 않는다면 결과도 보여지지 않는다. > textContent를 알기 전에 노드라는 개념을 알고 있어야하..
2023.03.02 -
[EJS] 스코프 이슈를 어떻게 해결할 것인가?
먼저 전체 코드를 본다. const express = require("express"); const bodyParser = require("body-parser"); const ejs = require("ejs"); var _ = require('lodash'); const homeStartingContent = "Lacus vel facilisis volutpat est velit egestas dui id ornare. Semper auctor neque vitae tempus quam. Sit amet cursus sit amet dictum sit amet justo. Viverra tellus in hac habitasse. Imperdiet proin fermentum leo vel orci ..
2023.02.20