TX

· ON/spring
글쓰기 버튼을 눌렀을때! 요청 주소로 넘어가기 위해서 location 을 이용할 것이다! 🤔 location이란 ? 현재 활성화된 웹페이지의 URL 정보를 포함하는 window 객체의 프로퍼티로 location.href로 현재 주소를 확인할 수 있다. 예시) location.href='/member/login' (해당 주소 요청(GET방식)) * 주소를 작성할 수 있는 방법 아래 2개 * location.href = "/board2/" + location.pathname.split("/")[2]; location.href = `/board2/${location.pathname.split("/")[2]}/insert` 📂 결과 : /board2/1/insert 📝 js 코드 if (insertBtn != ..
박도비
'TX' 태그의 글 목록