속성 | 예제 URL http://www.mins01.com:80/for2007/index.php?mm=2&sm=1#top |
hostname | 접속한 서버의 호스트네임(서브도메인등이 포함된 도메인 이름 or IP) ex> www.mins01.com |
href | 접속한 URL 주소(완변한 모양의 주소) ex> http://www.mins01.com:80/for2007/index.php?mm=2&sm=1#top |
host |
접속한 서버의 호스트네임과 포트(보통 도메인, 포트가 기본이 80번이지만 지정되지 않으므로 안보임) |
hash | href에 표시된 #~~~~ 부분 ex> #top |
port | 서버에 접속 할 때 사용한 포트(기본값은 80 이지만 나타나지 않으므로 빈값) ex>80 |
pathname | 현재페이지의 위치와 파일이름 ex>/for2007/index.php |
search | href에서 표시된 ?~~~=~~~&~~~~=~~~~ (쿼리스트링) 부분 ex>?mm=2&sm=1 |
protocol | 접속에 사용된 프로토콜 (ex > http: , https:) ex>http: |
메소드 | |
assign | 페이지 이동(보통 같은 페이지 내의 #~~~~ 의 위치를 이동하기 위해서 사용됨 document.location.assign('#manual') |
reload | 현재 페이지 다시 읽기(href 주소와 동일한 페이지를 다시 읽는다. 히스토리가 변경되지 않는다.) document.location.reload() |
replace |
페이지 이동(window.open()과는 다르게 히스토리가 변경되지 않는다. 타겟을 지정할 수 없다.) |
현제 페이지의 location 정보
hash :
host : nosmoke.cctoday.co.kr
hostname : nosmoke.cctoday.co.kr
href : http://nosmoke.cctoday.co.kr/89
pathname : /89
port :
protocol : http:
search :
assign : function assign() { [native code] }
reload : function reload() { [native code] }
replace : function replace() { [native code] }
toString : function toString() { [native code] }
hostname : www.mins01.com
href : http://www.mins01.com/20070305/m_board/tech.php?b_id=tech&type=read&b_idx=358&page=1&sh1_ta=b_title&sh1_str=location&period=all
host : www.mins01.com
hash :
port :
pathname : /20070305/m_board/tech.php
search : ?b_id=tech&type=read&b_idx=358&page=1&sh1_ta=b_title&sh1_str=location&period=all
protocol : http: