TIL 2022.05.12 프로젝트 구현 내용 추가 정리 (이미지 업로드, 드래그 앤 드랍, ajax 비동기식 유효성검사)
이미지 업로드 profile.html {{ users.nickname }} 프로필 사진 변경 ... ... 프로필 사진을 출력하는 공간 프로필 사진 변경 버튼 클릭 시 change_profile() 함수 호출하도록 설정 function change_profile() { var url = '/change_profile'; var name = '프로필 사진 변경'; var option = 'width = 800, height = 800, top = 100, left = 200, location = no' window.open(url, name, option); } 팝업창을 띄우기 위해서 window.open(url, name, option) 함수 사용 (변수로 선언해서 내용 지정한 뒤 파라미터로 전달) ap..
더보기
TIL 2202.05.08 클론코딩 팀프로젝트(BE) - 4 (request body, 매직 메서드, list빼기함수, 파이썬 list랜덤 추출)
ajax에서 request 요청 시 데이터를 http request body에 저장하여 보내는 방법 하나씩 일일이 보내는 방법 let id = $('#id').val() let pwd = $('#pwd').val() $.ajax ({ type: 'POST', url: '/', data: {'id_give' : id, 'pwd_give': pwd} suceess : .... }) dic 형태(json형태)로 보내는 방법 let data = { 'id' = $('#id').val(), 'pwd' = $('#pwd').val() } $.ajax({ type: 'POST', url: '/', data: JSON.stingify(data), contentType: "application/json; charset=..
더보기