본문 바로가기

컴퓨터/클라이언트

input type="file" 사용법 HTML 여러 파일이면 multiple 을 추가한다. JavaScript function chk_file_type(obj) { let file_kind = obj.value.lastIndexOf('.'); let file_name = obj.value.substring(file_kind+1,obj.length); let file_type = file_name.toLowerCase(); let check_file_type=new Array(); check_file_type=['jpg','gif','png','jpeg','bmp']; if(check_file_type.indexOf(file_type)==-1){ alert('이미지 파일만 선택할 수 있습니다.'); let parent_Obj=obj.paren..
JavaScript DOM 선택하기 * id로 선택 document.getElementById("item"); *태그로 선택 document.getElementsByTagName('p'); document.getElementsByTagName('p')[0]; *클래스로 선택 document.getElementByClassName("c1"); document.getElementByClassName("c1")[0]; *id 또는 태그 또는 클래스로 선택(여러개 중 첫번째 것을 선택한다.) document.querySelector("#item"); document.querySelector('p'); document.querySelector(".c1"); *여러 엘리먼트 선택 document.querySelectorAll("#item, .c1, ..
URI와 URL의 개념 1. URI(Uniform resource Identifier) 주소 + 전달값 예) http://www.example.co.kr/?name=홍길동 2. URL(Uniform Resource Locator) 주소 예) http://www.example.co.kr/ ※ 그래서 URI가 URL을 포함하는 포함관계가 있다.
HTTP GET 방식으로 서버에 요청하기 (작성중) 클라이언트에서 서버로 다음 정보를 보내며 요청한다고 가정하자. { user: "sayyesdoit", age: 30 } I. 쿼리스트링으로 정보를 보내며 요청하기 1. 브라우저 사용하기 2022.01.26 - [컴퓨터/클라이언트] - URI와 URL의 개념 URI와 URL의 개념 1. URI(Uniform resource Identifier) 주소 + 전달값 예) http://www.example.co.kr/?name=홍길동 2. URL(Uniform Resource Locator) 주소 예) http://www.example.co.kr/ ※ 그래서 URI가 URL을 포함하는 포함관.. bloghelloworld.tistory.com 1) 주소창에 URI 직접 입력 주소창에 다음과 같이 입력한다. URL..
자바스크립트 이벤트 Javascript Event 1. 이벤트의 종류 1) 마우스 이벤트 설명 click 요소에 마우스를 클릭했을 때 이벤트가 발생 dbclick 요소에 마우스를 더블클릭했을 때 이벤트가 발생 mouseover 요소에 마우스를 오버했을 때 이벤트가 발생 mouseout 요소에 마우스를 아웃했을 때 이벤트가 발생 mousedown 요소에 마우스를 눌렀을 때 이벤트가 발생 mouseup 요소에 마우스를 떼었을 때 이벤트가 발생 mousemove 요소에 마우스를 움직였을 때 이벤트가 발생 contextmenu context menu(마우스 오른쪽 버튼을 눌렀을 때 나오는 메뉴)가 나오기 전에 이벤트 발생 2) 키 이벤트 설명 keydown 키를 눌렀을 때 이벤트가 발생 keyup 키를 떼었을 때 이벤트가 발생 keypress 키를 누른 상태에..