본문 바로가기
웹관련/JavaScript-Jquery

[자바스크립트] Location 객체

by 착한덕환 2018. 8. 10.



location은 URL 정보를 가져오는 객체입니다.

URL 전체 또는 일부의 정보를 가져올수 있습니다.


- location

- location.host

- location.hostname

- location.href

- location.pathname

- location.protocol


예시)

http://mrb18.tistory.com/category/JavaScript-Jquery.html


- location

http://mrb18.tistory.com/category/JavaScript-Jquery.html


- loction.host

mrb18.tistory.com


- location.hostname

mrb18.tistory.com


- location.href

http://mrb18.tistory.com/category/JavaScript-Jquery.html


- location.pathname

/category/JavaScript-Jquery.html


- location.protocol

http:


웹작업을 하면서 은근히 많이 사용하게 됩니다 ^^

댓글