일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
- DB연결 문제
- 오라클
- 삼항연산자
- 외부접속 차단
- Join
- 겟터
- 생성자
- 객체
- 작성순서
- for문
- 생성자쓰는이유
- setter
- mixedcontent
- int오류
- 칼럼명에 별칭 지정
- getter
- SELECT 절
- .substring
- .repeat
- Java
- 자바
- HAVING
- SQL
- 프로그래머스
- 제어문
- 이터레이블
- system error 113
- 연산자
- ifelse
- 상속
- Today
- Total
목록JavaScript/JavaScript 실습 (6)
CoDream

로드 후 실행코드document.addEventListener("DOMContentLoaded" function() {...})와 $(document).ready(function() {...}) 모두 DOM이 완전히 로드된 후에 실행되는 코드를 지정하는 방법1. document.addEventListener("DOMContentLoaded", function() {...})표준 JavaScript 방법으로, DOMContentLoaded 이벤트는 초기 HTML 문서가 완전히 불러와지고 분석되었을 때 발생합니다. 이미지나 스타일시트 같은 외부 리소스는 반드시 다 로드되지 않았어도 됩니다.브라우저 호환성 측면에서 대부분의 최신 브라우저에서 지원됩니다.document.addEventListener("DOMC..

const obj ={ url : "/app/member/id-dup", type : "get", success : function (){console.log("통신성공😄"); }, error : function (){console.log("통신실패😥");}};$.ajax(obj); url : "/app/member/id-dup", type : "get", 위와 같은 방식의 요청을 받을 곳이 없어서 에러남. @WebServlet("/member/id-dup")public class MemberIdDupCheckController extends HttpServlet{ @Override protected void doGet(HttpServletRequest req, HttpServletRe..

https://jquery.com/download/ Download jQuery | jQueryDownload jQuery link Latest version To locally download these files, right-click the link and select "Save as..." from the menu. Download the compressed, production version: Download jQuery 3.7.1 The slim build is a smaller version, that excludes the ajaxjquery.com
색상 팔렛트 만들기 --div로 색상 팔렛트 만들기 --div크기, 커서(포인터) 지정 .color-option{ width: 50px; height: 50px; cursor: pointer;}--팔렛트를 배열로 변환 후 click-event가 생기면 색상 변경. const colorOptions = Array.from( document.getElementsByClassName("color-option"));function onColorClick(event){ ctx.strokeStyle=event.target.dataset.color; ctx.fillStyle=event.target.dataset.color;} colorOptions.f..
input타입 range, color 추가 js에서 event 에따라 굵기와 색상 변경할 수 있도록 함. const lineWidth = document.getElementById("line-width")const color = document.getElementById("color");function onLisneWidthChange(event){ ctx.lineWidth=event.target.value;}function onColorChange(event){ ctx.strokeStyle=event.target.value; ctx.fillStyle=event.target.value;}lineWidth.addEventListener("change",onLisneWidthChange);co..

moveTo(); const canvas = document.querySelector("canvas");const ctx = canvas.getContext("2d");canvas.width=800;canvas.height=800;ctx.lineWidth=2;ctx.moveTo(0,0);function onClick(event){ctx.lineTo(event.offsetX, event.offsetY);ctx.stroke();}canvas.addEventListener("click", onClick); ctx.moveTo(0,0); > 그림시작하는 곳을 canvas 기준 좌표(0, 0) 부터 시작하게됨. moveTo가 없다면?? 처음 클릭했을 때 선이 그어지지 않음. 처음 클릭한 곳에서 시작이 ..