front/javascript
submit, replace, href 차이
펭귄대장
2019. 8. 12. 19:10
[ submit, replace, href 차이 ]
submit
페이지 이동시 다음페이지로 데이터 전송
document.id.action="/test.do";
document.id.submit();
href
데이터 전송없이 페이지만 이동
location.href="/test.do";
replace
데이터 전송없이 페이지만 이동(새로운 페이지로 변경)
location.replace("/test.do");
※ href와 replace의 차이
href : 속성, 뒤로가기 가능
replace : 메소드, 뒤로가기 불가
https://yuchae.tistory.com/223
https://opentutorials.org/module/2919/22904
반응형