Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- explorer
- SSH
- Command
- script
- Programming
- UNIX
- program
- PC
- webhard
- MS Windows PE
- LiveCD(USB)
- FTP
- javascript
- Disk Partition
- calculator
- portable
- web
- Crack(Serial Key)
- Linux
- MS windows
- Backup(Restore)
- 대항해시대
- Network Info(Tool)
- game
- network
- Windows 10
- Update
- apm
- H/W
- OS(operating system)
Archives
- Today
- Total
<In Story>
자바스크립트 현재 경로 현재 프로토콜등 구하기, Javascript get location // [Programming] [Script] [Web] [JavaScript] 본문
Programming/Web
자바스크립트 현재 경로 현재 프로토콜등 구하기, Javascript get location // [Programming] [Script] [Web] [JavaScript]
<In Story, Hi story, History> 2015. 9. 12. 19:25만약 당신이 지금
http://www.test.com/ver2/index.php?wr_id=4&bbs=free
라는 위치라면
window.location.protocol : http:
window.location.host : www.test.com (주소)
window.location.pathname : /ver2/index.php (경로)
window.location.search : ?wr_id=4&bbs=free (파라미터)
window.location.search.substring(1) : wr_id=4&bbs=free (파라미터)
저는 보통 아래와 같이 사용합니다.
function doLogin() {
location.href='/bbs/login.php?url='+urlencode(location.pathname + location.search);
}