• 회원가입
  • 로그인
  • 구글아이디로 로그인

[Window_Object] JS - window.frames 속성 - 프레임 윈도우객체속성 (= window.frames속성 = 윈도우프레임즈 속성)

목차
  1. window.frames 예제 - <iframe> 요소 접근
  2. window.frames 정의
  3. window.frames 구문
  4. window.frames 예제 - <iframe> 주소 일괄 변경

 

window.frames 예제 - <iframe> 요소 접근

 

<button onclick="hz()">클릭</button>

<br>

<iframe src="https://homzzang.com/html"></iframe>

<iframe src="https://homzzang.com/css"></iframe>


<script>

function hz() {

  window.frames[0].location = "https://homzzang.com/";

}

</script>

 

※ 첫 번째 iframe 주소를 homzzang.com으로 변경

 

window.frames 정의

 

현재 윈도우의 모든 <iframe> 요소를 나타내는 배열 모양의 객체 반환.

 



1.

<iframe> 요소는 0부터 시작하는 인덱스 번호로 접근 가능.


2.

프레임 개수 : frames.length


3.

<frame> 요소에도 적용. 

cf. HTML5 경우, <frame> 요소 지원 중단.


4.

읽기 전용.


5.

모든 브라우저가 지원.

 

 

window.frames 구문

 

window.frames

 

 

ps. 각 iframe은 [index] 이용해 접근. (예) window.frames[0]

 

window.frames 예제 - <iframe> 주소 일괄 변경

 

<button onclick="homzzang()">클릭</button>

<br><br>


<iframe src="https://google.com"></iframe>

<iframe src="https://daum.com"></iframe>

<iframe src="https://naver.com"></iframe>


<script>

function homzzang() {

  var po = window.frames;

  var i;


  for (i = 0; i < po.length; i++) {

    po[i].location = "https://homzzang.com";

  }

}

</script>


※ 모든 iframe 주소를 homzzang.com으로 변경.


 


분류 제목
Window_Object JS - getComputedStyle() 메서드 - 지정요소의 모든 스타일코드 얻기 (= CSS계산값 = …
Window_Object JS - getSelection() 메서드 - 사용자에 의해 선택된 텍스트 범위 나타내는 선택객체 (IE9)…
Window_Object JS - matchMedia() 메서드 ★ - 미디어쿼리리스트 객체 (MediaQueryList) 반환 (…
Window_Object JS - moveBy() 메서드 - 윈도우창 이동 (※ 현재위치기준해서 지정길이만큼 이동)
Window_Object JS - moveTo() 메서드 - 윈도우창 이동 (※ 지정위치로 이동 = 지정좌표로 이동)
Window_Object JS - open() 메서드 ★★★★★ - 팝업창 열기. (= open메서드 = 오픈메서드) + ( 새탭, …
Window_Object JS - print() 메서드 ★ - 윈도우창 인쇄하기 (= 프린트)
Window_Object JS - prompt() 메서드 ★ - 입력유도창 (= 입력요구창 = 입력창 = prompt메서드 = 프롬…
Window_Object JS - requestAnimationFrame() 메서드 - 다음 repaint 전에, 애니메이션을 업데이…
Window_Object JS - resizeBy() 메서드 - 윈도우창크기변경 (※ 현재크기 기준)
Window_Object JS - resizeTo() 메서드 - 윈도우창크기변경 (※ 지정크기로 변경)
Window_Object JS - scroll() 메서드 - 폐기예고. scrollTo() 메서드로 대체.
Window_Object JS - scrollBy() 메서드 ★ - 스크롤 이동 (※ 지정 픽셀 길이 만큼 이동 = scrollBy메…
Window_Object JS - scrollTo() 메서드 ★ - 스크롤이동 (※ 지정좌표로 이동 = scrollTo메서드 = 스크…
Window_Object JS - setInterval() 메서드 ★★★ - 일정 시간 후 자동 반복 실행. (= setInterva…
Window_Object JS - setTimeout() 메서드 ★★★ - 일정시간 후 1회 할일 지정. (= 촉발시간설정 = set…
Window_Object JS - stop() 메서드 - 창로드차단 (= 문서로드차단 = 창로드중단)
Window_Object JS - localStorage 속성 - 웹브라우저에 키/값 쌍을 데이터 영구저장 (IE8 이상) ※ 쿠키…
Window_Object JS - devicePixelRatio 속성 ★ - 기기 픽셀 비율. ※ PC, 모바일 구별하기
Window_Object JS - window.jQuery 속성 - 제이쿼리 라이브러리 로드 여부 확인 (= 윈도우제이쿼리속성)
3/3
목록
찾아주셔서 감사합니다. Since 2012