리자

타겟(target) 쓰는 법

· 2007-01-16 (화) 09:02:48 · 4964 · 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,204
07-01-25 조회 4,001
07-01-25 조회 5,010
07-01-24 조회 3,802
07-01-21 조회 4,637
07-01-21 조회 3,178
07-01-19 조회 6,580
07-01-19 조회 2,984
07-01-19 조회 7,291
07-01-19 조회 4,036
07-01-19 조회 7,225
07-01-19 조회 8,037
07-01-16 조회 4,965
07-01-13 조회 3,494
07-01-10 조회 3,342
07-01-09 조회 8,127
07-01-09 조회 3,583
07-01-09 조회 5,135
07-01-08 조회 6,533
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,771
06-12-27 조회 3,534
06-12-26 조회 4,650
06-12-21 조회 3,756
06-12-20 조회 3,726
06-12-18 조회 4,603
06-12-16 조회 5,830
06-12-15 조회 4,165
06-12-15 조회 3,968
06-12-15 조회 4,584
06-12-15 조회 7,445
06-12-15 조회 3,356
06-12-15 조회 3,172
06-12-15 조회 3,091
06-12-15 조회 3,194
06-12-15 조회 4,379
06-12-15 조회 3,469
06-12-15 조회 3,127
06-12-15 조회 2,870
06-12-15 조회 3,302
06-12-15 조회 4,541
06-12-15 조회 4,424
06-12-15 조회 3,141
06-12-15 조회 2,650
06-12-15 조회 4,422
06-12-15 조회 3,295
06-12-15 조회 2,841
06-12-15 조회 4,012
06-12-15 조회 3,149
06-12-15 조회 2,997
06-12-15 조회 2,999
06-12-15 조회 2,971
06-12-15 조회 3,435
06-12-15 조회 3,810
06-12-15 조회 2,935
06-12-15 조회 2,689
06-12-15 조회 2,718
06-12-15 조회 2,617
06-12-15 조회 4,365
06-12-15 조회 4,087
06-12-15 조회 2,835
06-12-15 조회 4,568
06-12-15 조회 2,992
06-12-15 조회 2,619
06-12-15 조회 3,123
06-12-15 조회 3,266
06-12-15 조회 2,783
06-12-15 조회 3,517
06-12-15 조회 3,195
06-12-15 조회 2,768
06-12-15 조회 2,920
06-12-15 조회 3,190
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,015
06-12-12 조회 5,548
06-12-12 조회 6,196
06-12-11 조회 4,386
06-12-10 조회 4,040
06-12-07 조회 4,642
06-12-07 조회 3,203
06-12-07 조회 3,552
06-12-07 조회 3,844
06-12-07 조회 3,942
06-12-07 조회 3,531
06-12-04 조회 2,788
06-12-04 조회 4,581
06-11-30 조회 3,110
06-11-30 조회 3,591
06-11-30 조회 3,638