1. Ajax에서 받아오는 dataType(data아님, data는 내가 가지고 있는 값을 보내는 것임)에는 text, json, xml, html이 있다.
2. xml, json은 api에서 제공하는 값을 가져오는 방식으로 많이 쓴다.
(지극히 내가 겪고 사용한 입장에서의 생각임)
**참고 페이지
https://velog.io/@garam0410/Java-OPEN-API-%ED%8C%8C%EC%8B%B1%ED%95%98%EA%B8%B0-XML
[Java] OPEN API 파싱하기 (XML)
OPEN API API란, Application Programming Interface의 약자로, 응용 프로그램에서 사용할 수 있도록, 운영 체제나 프로그래밍 언어가 제공하는 기능을 제어할 수 있게 만든 인터페이스를 뜻한다.
velog.io
3. json에서 성공(200)으로 나와도 error로 떨어트리는 경우가 있다.
json의 text타입(?)과 object타입의 차이
200이라는 성공 여부만 가져온 것이지 object 타입이 아니라서 오는 에러
**진짜 에러는 400, 403, 404, 500
**참고 페이지
text -> object
https://jsonformatter.curiousconcept.com
JSON Formatter & Validator
Format and validate JSON data so that it can easily be read by human beings.
jsonformatter.curiousconcept.com
JS 함수명 : JSON.parse()
https://www.w3schools.com/js/js_json_parse.asp
JSON.parse()
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
www.w3schools.com
4. Ajax의 절차
- beforeSend, success, error, complete
- 데이터를 받는데 시간이 걸릴 경우 돌리는 이미지(??)를 넣는 부분
(개인의견 : 보통 beforeSend에 넣지 않을까??, 아직 사용 안해보았음)
5. async(어씽크, 에이씽크), cache
- async의 값은 true와 false가 있다. default값(기본값)은 true(비동기)
○비동기 : Ajax의 결과값의 여부와 상관없이 남아있는 명령(코드) 실행
○동기 : Ajax의 결과값의 여부를 출력 후 남아있는 명령(코드) 실행
오타 지적과 태클은 언제나 환영입니다.
출처 :
garam0410 (garam0410) - velog
[JPA] 4. JPA Mapping JPA를 사용하면서 Entity와 Table 매핑은 가장 중요함Mapping Annotation을 지원하는데, 크게 4가지로 나뉨객체와 테이블 매핑 : @Entity, @Table기본키 매핑 : @Id필드와 컬럼 매핑 : @Column연관
velog.io
https://jsonformatter.curiousconcept.com
JSON Formatter & Validator
Format and validate JSON data so that it can easily be read by human beings.
jsonformatter.curiousconcept.com
W3Schools Free Online Web Tutorials
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
www.w3schools.com
'JavaScript & JQuery 참조' 카테고리의 다른 글
[JQuery] 브라우저 객체 관련 (0) | 2023.01.25 |
---|---|
[JQuery] input radio 중복 체크 될 때 (수정중) (0) | 2023.01.10 |
[JS] async & await (ajax아님) (0) | 2022.09.22 |
[jQuery] input checkbox 배열에 담기 (0) | 2022.09.01 |
에러로그(본인인증 관련) (0) | 2022.08.08 |