★너무 꼬치꼬치 파고 들어가진 말기
서버-클라이언트 통신
{
"squadName": "Super hero squad",
"homeTown": "Metro City",
"formed": 2016,
"secretBase": "Super tower",
"active": true,
"members": [
{
"name": "Molecule Man",
"age": 29,
"secretIdentity": "Dan Jukes",
"powers": [
"Radiation resistance",
"Turning tiny",
"Radiation blast"
]
}
출처: https://developer.mozilla.org/ko/docs/Learn/JavaScript/Objects/JSON
AJAX의 정의
$.ajax({
type: "GET", // 어떤 방식으로 요청 할 것인지
url: "url",
data: {}, // 요청하면서 함께 줄 데이터 (GET 요청시엔 공란)
success: function(변수){ // 서버에서 받은 결과를 변수에 담음. 보통 response 많이 씀
//내용 작성
}
})