2016-09-15 2 views
4

window.popstate이 해고 될 때 새 페이지의 URL을 가져올 수있는 방법이 있습니까?window.popstate에서 새 URL 가져 오기

window.onpopstate(function(){ 
    newPageUrl = //get the new page's URL 
}) 
+0

하지'location.href' 사용할 수 있습니까? . window.onpopstate = 함수() {} HTTPS : –

+0

window.location.href.toString() 스플릿 (window.location.host)는 [1] –

답변

3

사용이

window.onpopstate(function(){ 
    newPageUrl = location.href; 
}) 
+1

이 오른쪽 구문 // 현상 .mozilla.org/ko-ko/docs/웹/API/WindowEventHandlers/onpopstate – Marian07