JQuery
getElementById 같이 HTML 핸들링을 간단하게 해주는 JS (일부 JS 순수 함수들을 래핑한 API도 있다)
제이쿼리에서는 변수를 지양하는 게 좋다 (가독성)
(1) Syntax
①~③ 은 배열형태로 반환 ④은 단일값으로 반환되기 때문에 순환구조가 없음
①$(this).hide() - hides the current element.
②$("p").hide() - hides all <p> elements.
③ $(".test").hide() - hides all elements with class="test".
④$("#test").hide() - hides the element with id="test".
HTML의 <body> 태그가 다 실행된 후 실행, document.eventListener... 축약
<head>단에 <script>가 있을때 해당 코드를 적으면, <body> 제일 아래에 script코드가 있는 것처럼 실행이 된다.
$(document).ready(function(){ // jQuery methods go here... }); |
$(function(){ // jQuery methods go here... }); |
(2) Getter / Setter - 따라오는 .val() 함수에 매개값이 없으면 getter 있으면 setter
- text() - Sets or returns the text content of selected elements
ㄴ 태그 안에 글자를 들고오고싶을 때/셋팅 - html() - Sets or returns the content of selected elements (including HTML markup)
ㄴ 태그 안에 다른 태그가 있을 때 해당범위 전부 가지고올때/셋팅 - val() - Sets or returns the value of form fields
ㄴ input 태그의 속성
ㄴ (주의)textarea안에 있는 값들은 val로 인식한다
MyBatis
Parameter과 return 타입 둘다 축약형을 지원한다
원칙대로라면 Integer같이 참조형 타입으로 적고 경로를 java.util.Integer처럼 적어야하지만
int로만 적어도 오토박싱/언박싱 지원 및 경로를 알아서 지정해준다.
또한 Map도 java.util.map이 아니라 map으로만 적어도 된다/
'HTML, CSS, JS' 카테고리의 다른 글
팝업창 해상도 상관없이 컨텐츠 너비/높이 (0) | 2025.02.10 |
---|---|
[JQuery] checkBox type인 input 활용 (0) | 2024.11.26 |
Css - syntax, selectors (0) | 2024.10.25 |