href 는 속성이고 , replace() 는 함수이다.
The replace() method replaces the current document with a new one.
replace() 메소드는 현재 문서를 새로운 것으로 대체시킨다.
The difference between this method and assign(), is that replace() removes the URL of the current document from the document history, meaning that it is not possible to use the "back" button to navigate back to the original document.
이 메소드와 assign() 메소드의 차이점은, replace() 메소드는 현재 문서가 문서 히스토리로부터 제거된다는 것이다. 이 말은 "back"버튼을 사용해 원래의 문서로 돌아갈 수 없다는 것이다.
https://www.w3schools.com/jsref/met_loc_replace.asp
Location replace() Method
Location replace() Method ❮ Location Object Example Replace the current document: location.replace("https://www.w3schools.com"); Try it Yourself » Definition and Usage The replace() method replaces the current document with a new one. The difference bet
www.w3schools.com
https://www.w3schools.com/jsref/prop_loc_href.asp
Location href Property
Location href Property ❮ Location Object Example Return the entire URL (of the current page): var x = location.href; The result of x will be: document.write(location.href); --> Try it Yourself » More "Try it Yourself" examples below. Definition and Usag
www.w3schools.com
'FrontEnd > HTML' 카테고리의 다른 글
HTML meta 요소는 무엇일까? (0) | 2021.06.29 |
---|---|
server-sent event(SSE) 서버에서 클라이언트로 이벤트 보내기 (0) | 2021.06.17 |