javascript
window.location.host #returns host
window.location.hostname #returns hostname
window.location.pathname #return pathname
window.location.href #returns full current url
window.location.port #returns the port
window.location.protocol #returns the protocol
jQuery
$(location).attr('host'); #returns host
$(location).attr('hostname'); #returns hostname
$(location).attr('pathname'); #returns pathname
$(location).attr('href'); #returns href
$(location).attr('port'); #returns port
$(location).attr('protocol'); #returns protocol
'개발일기 > JavaScript' 카테고리의 다른 글
[JavaScript] alert창 줄바꿈 (2줄로 만들기,개행처리) (0) | 2021.02.04 |
---|---|
[jQuery] 배열에 포함되어있는지 검사하기 (0) | 2021.01.27 |
[JavaScript] 페이지 새로고침 하는법 (0) | 2021.01.21 |
[JQuery] 체크박스 갯수 / 체크여부 확인 (0) | 2021.01.20 |