현재 문서의 주소(URL) 정보를 반환하거나 설정한다.
![]() | Script | document.URL=[urlVal] |
HTML | 없음 |
현재 문서나 지정한 문서의 개체이다.
URL 속성은 언제나 설정이 가능하고, 설정되면 바로 해당 페이지 주소로 이동한다.
이 속성은 읽기/쓰기이며 디폴트값은 없다.
URL(Uniform Resource Locator) 속성은 대소문자를 구별하여야 한다.
개체 | script | HTML | 규격 | IE |
---|---|---|---|---|
document | document.URL[=urlVal] | 없음 | 없음 | IE4.0(win16,win32,ce,unix,mac) |
참조 | urn 속성 | URLUnencoded 속성 | |||||
protocol 속성 | host 속성 | hostname 속성 | port 속성 | pathname 속성 | hash 속성 | target 속성 | |
search속성 | href 속성 | URL 속성 | domain 속성 | link 개체 | location 개체 | Url 개체 |
이 속성은 (영문) W3C DOM Level 1(Document Object Model)에서 정의되었다.
![]() | URL 속성⇒ | ![]() | ![]() ![]() ![]() |
<A href="http://trio.co.kr/cgi/bbs/triobbs.cgi?db=triobbs">trio 게시판</A><BR> <SCRIPT> for (i=0;i<document.links.length;i++){ if(document.links[i].URL) document.write(document.links[i].href+'<BR><FONT color=green>'+document.links[i].URL+'</FONT><BR>'); } document.write('document.URL=<FONT color=blue>'+document.URL+'</FONT><BR>'); document.write('top.document.URL=<FONT color=blue>'+top.document.URL+'</FONT>'); </SCRIPT> <DIV onClick="document.URL='http://trio.co.kr/webrefer/tutmain.html'" style="border:solid 1 blue;padding:5;background:eef;width:150;margin-left:100">색인표로 가기 클릭</DIV>
![]() | URL 속성 | ⇒ | ![]() ![]() |
최종 수정: 05/20/2025 00:45:42 | ![]() All right reserved | 비정상적인 방식으로 프레임없이 페이지에 접속하면 자주 오류가 발생됩니다. 오류가 나면 정상적 접속으로 시도해 보세요. | http://koxo.com/lang/js/property/URL.html |