프론트엔드 개발자 - 자곰

Front-end/snippets 정리

2. location 관련한 snippets

자곰 2022. 2. 7. 16:33

1. getProtocol

- 현재 프로토콜 확인 ( http, https )  

const getProtocol = () => window.location.protocol;
getProtocol()

 

2. currentURL

- 현재 url return 

const currentURL = () => window.location.href;

'Front-end > snippets 정리' 카테고리의 다른 글

1. url parsing  (0) 2022.02.07