프로그래밍 언어/HTML,CSS,JS
JavaScript를 사용하여 페이지를 다시 로드하는 방법
Rateye
2021. 12. 12. 23:15
728x90
반응형
질문 : JavaScript를 사용하여 페이지를 다시로드하는 방법
JavaScript를 사용하여 페이지를 다시로드하려면 어떻게해야합니까?
모든 브라우저에서 작동하는 방법이 필요합니다.
답변
자바 스크립트 1.2
window.location.reload(false);
// If we needed to pull the document from
// the web-server again (such as where the document contents
// change dynamically) we would pass the argument as 'true'.
자바 스크립트 1.1
window.location.replace(window.location.pathname + window.location.search + window.location.hash);
// does not create a history entry
enter code here
자바 스크립트 1.0
window.location.href = window.location.pathname + window.location.search + window.location.hash;
// creates a history entry
출처 : https://stackoverflow.com/questions/3715047/how-to-reload-a-page-using-javascript
728x90
반응형