Development/JavaScript
자바스크립트 현재 URL 가져오기
Yeony99
2022. 5. 30. 12:32
728x90
- window.location.href : 현재 페이지의 href 반환
- window.location.hostname: 웹호스트 도메인 네임 반환
- window.location.pathname: 현재 페이지 경로, 파일 이름 반환
- window.location.protocol : 사용 중인 웹 프로토콜 반환(http://나 https://)
- window.location.assign: 새로운 document 로드하기
728x90