현재 문서의 주소(URL) 정보를 반환하거나 설정한다.

Scriptdocument.URL=[urlVal]
HTML없음
인수
document : (문서 개체)

현재 문서나 지정한 문서의 개체이다.

urlVal : (속성 문자열)
URL 속성값은 현재 문서의 완전한 주소(URL) 정보를 나타내는 문자열이다.

URL 속성은 언제나 설정이 가능하고, 설정되면 바로 해당 페이지 주소로 이동한다.

이 속성은 읽기/쓰기이며 디폴트값은 없다.

구문
document.write(document.URL)
document.URL='Val'
특기

URL(Uniform Resource Locator) 속성은 대소문자를 구별하여야 한다.

이 속성은 윈도우의 location.href 속성의 별명이다.

적용
개체scriptHTML규격IE
documentdocument.URL[=urlVal]없음없음IE4.0(win16,win32,ce,unix,mac)

이 속성은 (영문) W3C DOM Level 1(Document Object Model)에서 정의되었다.


property
URL 속성
URL</b> 속성이전페이지로페이지 맨위로페이지 맨아래로
trio 게시판
document.URL=http://koxo.com/lang/js/property/URL.html
top.document.URL=http://koxo.com/lang/js/property/URL.html
색인표로 가기 클릭
<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>
property
URL 속성
견본
이전페이지로페이지 맨위로
최종 수정:
05/20/2025 00:45:42
KoXo Homepage
All right reserved
비정상적인 방식으로 프레임없이 페이지에 접속하면 자주 오류가 발생됩니다.
오류가 나면 정상적 접속으로 시도해 보세요.
http://koxo.com/lang/js/property/URL.html