프로그램을 작성한다는 건 한편의 플로우 차트를 짜는 것과 같습니다.
제 생각입니다만 내가 머릿속에 그린 플로우 차트의 가지에 담긴 상황이라면, 예외는 아닙니다.
AJAX를 하기 위해서 XHR API를 활용하는 것
XML HTTP Request
XMLHttpRequest (XHR) is an API in the form of an object whose methods transfer data between a web browser and a web server. The object is provided by the browser's JavaScript environment. Particularly, retrieval of data from XHR for the purpose of continually modifying a loaded web page is the underlying concept of Ajax design. Despite the name, XHR can be used with protocols other than HTTP and data can be in the form of not only XML,[1] but also JSON,[2] HTML or plain text.[3]
어쨌든 (객체형태?)의 API이고 (API 아래)
웹 브라우저와 웹서버 사이에서 데이터를 전송하고
자바스크립트 환경의 브라우저에서 제공되고
로드된 웹페이지의 지속적인 수정을 위해 데이터를 XHR로부터 계속 검색하기 위해서
서버가 전달하는 데이터 형식이 xml, json
XML, JSON 다 가능 (요즘 인기는 JSON)
In computing, an application programming interface (API) is an interface that defines interactions between multiple software applications or mixed hardware-software intermediaries.[1] It defines the kinds of calls or requests that can be made, how to make them, the data formats that should be used, the conventions to follow, etc. - 위키
답변 버튼 클릭 -> script.js에서 이벤트 캐치?해서 (디폴트로 실행되는 이벤트를 막고) json으로 만들어 해당 url로 전송 -> @RestController에서 검증 및 수행 후 데이터 저장 -> 결과를 json으로 응답 -> script.js에서 html에 해당 데이터 or 응답 결과 뿌려주기
$.ajax({
type: 'post',
url: url,
data: queryString,
dataType: 'json',
error: function (xhr, status) {
alert(xhr.responseText);
},
명령어 mv
- 파일이동 (상위 디렉토리로도 이동 가능 ../ 활용)
- mv 파일이름 경로
https://m.blog.naver.com/PostView.nhn?blogId=diceworld&logNo=220190468271&proxyReferer=https:%2F%2Fwww.google.com%2F