본문 바로가기
  • 그냥 하자
Web Programing

현재 페이지 주소 출력하기

by Mash 2011. 9. 2.
반응형
<script type="text/javascript">

// 곧바로 현재 페이지 주소 출력
document.writeln(location.href);


// 변수에 넣어서 출력
var s = location.href;
document.writeln(s);

</script>

iframe으로 걸었을 경우 함수 호출 위치에 따라 iframe의 값을 가져온다. 
반응형