Location Object
Last updated
Was this helpful?
Last updated
Was this helpful?
Location 객체는 문서의 주소와 관련된 객체로 Window 객체의 프로퍼티다.
이 객체를 이용해서 윈도우 문서 URL 변경 가능.
문서의 위치와 관련된 다양한 정보 얻을 수 있음
console.log (location.toString(), location.href);
location 객체는 URL을 의미에 따라서 별도의 프로퍼티로 제공
console.log(location.protocol, location.host, location.port, )
현재 문서를 으로 이동
location.href = ""
같은 효과를 낸다
location = "";
현재 문서를 리로드하는 간편한 방법
location.reload();