blog
[JavsScript] URL으로부터 parameter 얻기 본문
[해당 페이지 URL 가져오기]
document.location.href
[URL parameter 값 가져오기]
location.search
[?age=60&office=london] 이런 형식으로 가져온다.
참고 : https://fellowtuts.com/jquery/getting-query-string-values-in-javascript/?a=a
예시
https://example:8090/current_page_url?age=60
window.location.hostname; // example
window.location.href; // https://example:8090/current_page_url?age=60
window.location.host; // example:8090
window.location.port; // 8090
window.location.pathname; // /current_page_url
window.location.search; // ?age=60
window.location.protocol; // https:
'Web > front-end' 카테고리의 다른 글
[JavsScript] URL parameter 값 가져오기(정규식) (0) | 2022.05.30 |
---|---|
[DataTables] 내부에 버튼 만들기 (0) | 2022.05.30 |
[DataTables] mouse over - rowCallback 추가 (0) | 2022.03.19 |
[javascript] 팝업 페이지 자동 사이즈 조정 (0) | 2022.03.19 |
[DataTables] ajax 통신으로 데이터를 받아서 테이블에 넣기 (0) | 2022.03.16 |