Contents

Develop
2017.12.14 15:51

[js] URL 파싱하기 (jQuery 안쓰고)

Views 1304 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

jQuery 안쓰고 URL 파싱하기

A 태그를 동적으로 생성해서 HREF 속성을 URL로 채우면,

나머지 속성을 다음과 같은 방법으로 읽어낼 수 있다.

var parser = document.createElement('a');

parser.href = "https://hooni.net:443/lab/?m=macbook#hash";
parser.protocol; // => "https:"
parser.host;     // => "hooni.net:443"
parser.hostname; // => "hooni.net"
parser.port;     // => "443"
parser.pathname; // => "/lab/"
parser.hash;     // => "#hash"
parser.search;   // => "?m=macbook"
parser.origin;   // => "https://hooni.net:443"



?

List of Articles
No. Category Subject Author Date Views
9 Algorithm [algorithm] Greedy (탐욕 기법) hooni 2003.04.23 15108
8 Algorithm [security] RSA 암호화 설명과 예.. hooni 2013.04.23 16616
7 Algorithm 스터디 자료, 암호화에 대해서.. 나중에 볼 ppt.. file hooni 2013.04.23 13370
6 Algorithm [security] 블럭 암호에 대해서.. hooni 2013.04.23 17118
5 Algorithm Polynomial time 이란? ㅋㅋ hooni 2013.04.23 22679
4 Algorithm 암호 알고리즘 및 프로토콜의 이해.. file hooni 2013.04.23 17208
3 Algorithm 디피헬만(Diffie-Hellman) 초간단 개념.. hooni 2013.04.23 81019
2 Algorithm 러시아 페인트공 알고리즘에 대해.. hooni 2013.04.23 22895
1 Algorithm OCB5 Injection 앗싸뵹! ㅋㅋ file hooni 2014.07.01 796
Board Pagination Prev 1 Next
/ 1