리자

타겟(target) 쓰는 법

· 2007-01-16 (화) 09:02:48 · 4965 · 2
프레임을 쓰실때 생각할 것 세가지
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개

2007-02-03 (토) 10:36:11
와 좋은 정보 감사합니다.
고맙습니다.
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
07-01-26 조회 6,206
07-01-25 조회 4,003
07-01-25 조회 5,011
07-01-24 조회 3,803
07-01-21 조회 4,637
07-01-21 조회 3,178
07-01-19 조회 6,580
07-01-19 조회 2,984
07-01-19 조회 7,294
07-01-19 조회 4,036
07-01-19 조회 7,225
07-01-19 조회 8,037
07-01-16 조회 4,966
07-01-13 조회 3,494
07-01-10 조회 3,342
07-01-09 조회 8,128
07-01-09 조회 3,583
07-01-09 조회 5,136
07-01-08 조회 6,534
07-01-08 조회 3,954
07-01-07 조회 2,895
07-01-06 조회 2,749
07-01-02 조회 2,693
07-01-02 조회 2,965
07-01-01 조회 2,980
07-01-01 조회 2,999
06-12-29 조회 2,935
06-12-29 조회 3,773
06-12-27 조회 3,534
06-12-26 조회 4,650
06-12-21 조회 3,756
06-12-20 조회 3,727
06-12-18 조회 4,604
06-12-16 조회 5,832
06-12-15 조회 4,166
06-12-15 조회 3,970
06-12-15 조회 4,584
06-12-15 조회 7,446
06-12-15 조회 3,356
06-12-15 조회 3,173
06-12-15 조회 3,093
06-12-15 조회 3,197
06-12-15 조회 4,379
06-12-15 조회 3,469
06-12-15 조회 3,131
06-12-15 조회 2,873
06-12-15 조회 3,302
06-12-15 조회 4,541
06-12-15 조회 4,424
06-12-15 조회 3,141
06-12-15 조회 2,652
06-12-15 조회 4,425
06-12-15 조회 3,295
06-12-15 조회 2,844
06-12-15 조회 4,014
06-12-15 조회 3,151
06-12-15 조회 2,998
06-12-15 조회 3,001
06-12-15 조회 2,973
06-12-15 조회 3,437
06-12-15 조회 3,810
06-12-15 조회 2,937
06-12-15 조회 2,689
06-12-15 조회 2,718
06-12-15 조회 2,617
06-12-15 조회 4,365
06-12-15 조회 4,091
06-12-15 조회 2,835
06-12-15 조회 4,568
06-12-15 조회 2,994
06-12-15 조회 2,620
06-12-15 조회 3,125
06-12-15 조회 3,266
06-12-15 조회 2,783
06-12-15 조회 3,517
06-12-15 조회 3,197
06-12-15 조회 2,769
06-12-15 조회 2,920
06-12-15 조회 3,192
06-12-15 조회 2,962
06-12-13 조회 2,726
06-12-13 조회 2,809
06-12-13 조회 4,302
06-12-12 조회 3,266
06-12-12 조회 3,016
06-12-12 조회 5,549
06-12-12 조회 6,197
06-12-11 조회 4,386
06-12-10 조회 4,041
06-12-07 조회 4,642
06-12-07 조회 3,205
06-12-07 조회 3,552
06-12-07 조회 3,844
06-12-07 조회 3,942
06-12-07 조회 3,532
06-12-04 조회 2,790
06-12-04 조회 4,583
06-11-30 조회 3,111
06-11-30 조회 3,595
06-11-30 조회 3,638