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 | 29 | 30 | 31 |
Tags
- script
- H/W
- javascript
- webhard
- portable
- Disk Partition
- network
- Backup(Restore)
- LiveCD(USB)
- Crack(Serial Key)
- calculator
- Programming
- SSH
- apm
- UNIX
- explorer
- Windows 10
- Network Info(Tool)
- 대항해시대
- Linux
- OS(operating system)
- Command
- MS Windows PE
- web
- PC
- MS windows
- program
- FTP
- Update
- game
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);
}