Modify the URL without reloading the page, 페이지 이동없이 URL변경

less than 1 minute read

http://stackoverflow.com/questions/824349/modify-the-url-without-reloading-the-page function processAjaxData(response, urlPath){ document.getElementById(“content”).innerHTML = response.html; document.title = response.pageTitle; window.history.pushState({“html”:response.html,”pageTitle”:response.pageTitle},””, urlPath); }

window.onpopstate = function(e){ if(e.state){ document.getElementById(“content”).innerHTML = e.state.html; document.title = e.state.pageTitle; } };


🔗original-link

Updated: