1. 자주 사용하는 location 객체
// Ex) https://test.com:80/newpost?type=post
window.location.href
// Ex) https:
window.location.protocol
// Ex) test.com:80
window.location.host
// Ex) test.com
window.location.hostname
// Ex) 80
window.location.port
// Ex) newpost
window.location.pathname
// Ex) ?type=post
window.location.search
2. 참고
728x90