Develop
2017.12.14 15:51

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

Views 1306 Votes 0 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"


?

  1. [ios] UIView에서 상위 UIViewController 가져오기

  2. [ios] UITableView 특정 Row만 Update

  3. [ios] UILabel top alignㅎㅎ

  4. [ios] UIColor 지정에서 RGB define ㅎㅎ

  5. [ios] UIButton multi-line iOS7

  6. [ios] UIAlertView 초간단 샘플 ㅎㅎ

  7. [ios] UDID와 UUID (디바이스의 Unique Identifier)

  8. [ios] UDID 사용 제한에 따른 대안들

  9. [ios] Touch ID 적용 샘플 코드 (예제)

  10. [ios] Thread Loop 내에서 UI 업데이트 방법

  11. [ios] TextField 특정 문자만 사용하도록 하기

  12. [ios] Swift 4 String, Date, DateFormatter 예제

  13. [ios] Swift 4 Singleton inheritance

  14. [ios] Swift 4 Dictionary 사용하기

  15. [ios] StoryBoard(xib) 없이 프로젝트 만들기

  16. [ios] Start developing your navigation app for CarPlay without enrollment

Board Pagination Prev 1 ... 38 39 40 41 42 ... 74 Next
/ 74