리자

타겟(target) 쓰는 법

프레임을 쓰실때 생각할 것 세가지
1. frame_name.location = 'url.php';
또는 frame_name.location.href = 'url.php';
또는 frame_name.location.replace('url.php')
2. parent.frame_name.location = 'url.php';
3. opener.parent.frame_name.location = 'url.php';

새창을 열게해준 창의 주소를 바꾸고 새창을 끈다.
<script>
opener.location.href = 'url.php';
self.close();
</script>

새창을 열게해준 창의 주소를 새로고침하고 새창을 끈다
<script>
opener.location.reload();
self.close();
</script>

다른 프래임의 주소를 바꾸게 하려면
<script>
frame_name.location.href = 'url.php';
</script>

프래임 구조상 상위 프래임의 주소를 바꾸게 하려면
<script>
parent.location.href = 'url.php';
</script>

타겟이 지정된 프레임을 바꾼다.(타겟하나)
<script>
parent.target(타겟).location.href = 'url.php';
</script>

타겟이 지정된 프레임을 바꾼다.(타겟둘)
<script>
parent.target1(타겟1).location.href = 'url1.php';
parent.target2(타겟2).location.href = 'url2.php';
</script>

타겟이 지정된 프레임을 바꾼다.(타겟셋)
<script>
parent.target1(타겟1).location.href = 'url1.php';
parent.target2(타겟2).location.href = 'url2.php';
parent.target3(타겟3).location.href = 'url3.php';
</script>

타겟이 지정된 프레임두개를 클릭으로 바꾸려면
<script>
function target_frame(url1, url2)
{
parent.top_frame.location.href = url1;
parent.main_frame.location.href = url2;
}
</script>
<a href="javascript:target_frame('main_menu.html', '$go_url');"> 확인 </a>

로그인페이지 에선
<script>
parent.top_frame.location.href = '../main.html'; //main.html는 로그인페이지 보다 상위디렉토리에 있다.
parent.main_frame.location.href = '$go_url';
</script>

로그인페이지를 새창으로 띄웠다면
<script>
opener.parent.top_frame.location.href = '../main.html';
opener.parent.main_frame.location.href = '$go_url';
self.close();
</script>


[펌] http://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=tipntech&wr_id=5317&sfl=&stx=&sst=wr_hit&sod=desc&sop=and&page=36<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]</div>

댓글 2개

와 좋은 정보 감사합니다.
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
07-03-10 조회 5,014
07-03-09 조회 4,025
07-03-08 조회 4,510
07-03-08 조회 3,993
07-03-08 조회 2,882
07-03-08 조회 3,309
07-03-08 조회 4,926
07-03-08 조회 4,193
07-03-07 조회 4,188
07-03-07 조회 4,843
07-03-07 조회 3,352
07-03-06 조회 3,500
07-03-05 조회 4,451
07-03-05 조회 3,049
07-03-04 조회 3,426
07-03-04 조회 3,703
07-03-04 조회 2,920
07-03-04 조회 3,335
07-03-04 조회 3,123
07-03-03 조회 3,713
07-03-02 조회 3,119
07-03-02 조회 2,912
07-03-02 조회 2,951
07-03-02 조회 2,950
07-03-02 조회 3,959
07-03-02 조회 2,782
07-03-02 조회 6,857
07-03-01 조회 3,620
07-03-01 조회 2,821
07-03-01 조회 5,956
07-02-28 조회 3,236
07-02-27 조회 6,121
07-02-27 조회 4,423
07-02-26 조회 3,338
07-02-26 조회 3,020
07-02-26 조회 3,364
07-02-26 조회 2,984
07-02-26 조회 3,048
07-02-26 조회 3,116
07-02-25 조회 3,731
07-02-24 조회 4,840
07-02-24 조회 7,187
07-02-24 조회 5,035
07-02-23 조회 4,360
07-02-23 조회 3,412
07-02-23 조회 3,680
07-02-23 조회 3,427
07-02-23 조회 3,646
07-02-23 조회 3,611
07-02-22 조회 4,034
07-02-22 조회 3,847
07-02-22 조회 3,274
07-02-22 조회 4,557
07-02-21 조회 4,922
07-02-21 조회 5,110
07-02-21 조회 4,619
07-02-20 조회 4,703
07-02-19 조회 3,852
07-02-19 조회 3,749
07-02-19 조회 3,710
07-02-19 조회 3,575
07-02-19 조회 3,859
07-02-18 조회 5,139
07-02-17 조회 4,880
07-02-16 조회 3,342
07-02-15 조회 3,225
07-02-15 조회 2,775
07-02-14 조회 5,223
07-02-14 조회 7,112
07-02-14 조회 8,184
07-02-14 조회 3,846
07-02-12 조회 3,952
07-02-12 조회 5,440
07-02-12 조회 3,486
07-02-11 조회 4,871
07-02-10 조회 4,189
07-02-10 조회 4,076
07-02-10 조회 3,580
07-02-10 조회 3,831
07-02-09 조회 3,959
07-02-09 조회 4,457
07-02-08 조회 4,987
07-02-08 조회 4,616
07-02-04 조회 4,097
07-02-04 조회 3,633
07-02-03 조회 4,239
07-02-03 조회 4,332
07-02-02 조회 3,824
07-02-02 조회 3,646
07-02-02 조회 4,638
07-02-02 조회 6,315
07-02-02 조회 6,432
07-02-01 조회 3,651
07-01-31 조회 3,498
07-01-30 조회 6,386
07-01-30 조회 1만
07-01-29 조회 3,358
07-01-28 조회 6,264
07-01-27 조회 5,746
07-01-26 조회 3,903