리자

타겟(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건
+
제목 글쓴이 날짜 조회
06-09-11 조회 3,306
06-09-10 조회 3,132
06-09-05 조회 5,464
06-09-02 조회 3,927
06-09-01 조회 3,279
06-09-01 조회 3,607
06-08-27 조회 3,386
06-08-27 조회 3,140
06-08-27 조회 2,921
06-08-27 조회 2,663
06-08-27 조회 2,575
06-08-25 조회 4,096
06-08-25 조회 2,635
06-08-23 조회 4,927
06-08-20 조회 3,665
06-08-19 조회 3,490
06-08-18 조회 2,919
06-08-18 조회 3,021
06-08-11 조회 4,184
06-08-10 조회 2,861
06-08-06 조회 4,523
06-08-05 조회 3,311
06-08-05 조회 2,796
06-07-31 조회 3,442
06-07-30 조회 2,990
06-07-29 조회 3,423
06-07-26 조회 2,926
06-07-26 조회 3,330
06-07-25 조회 3,799
06-07-20 조회 3,463
06-07-20 조회 3,756
06-07-19 조회 3,914
06-07-19 조회 2,989
06-07-19 조회 4,822
06-07-14 조회 3,774
06-07-13 조회 4,056
06-07-11 조회 3,109
06-07-11 조회 2,865
06-07-11 조회 4,816
06-07-11 조회 2,626
06-07-11 조회 2,989
06-06-24 조회 4,045
06-06-24 조회 3,497
06-06-13 조회 4,437
06-06-13 조회 3,342
06-06-11 조회 3,256
06-06-08 조회 3,315
06-06-08 조회 3,445
06-06-08 조회 3,862
06-06-07 조회 3,735
06-06-05 조회 3,957
06-06-02 조회 3,537
06-06-01 조회 4,198
06-05-28 조회 3,855
06-05-26 조회 4,415
06-05-22 조회 3,247
06-05-15 조회 3,732
06-05-14 조회 7,086
06-05-11 조회 3,627
06-05-11 조회 4,203
06-05-11 조회 3,672
06-05-11 조회 2,577
06-05-11 조회 2,845
06-05-11 조회 2,505
06-05-10 조회 3,996
06-05-09 조회 4,867
06-05-07 조회 2,664
06-05-07 조회 2,896
06-05-07 조회 2,599
06-05-06 조회 3,774
06-04-28 조회 3,438
06-04-25 조회 3,838
06-04-25 조회 3,559
06-04-22 조회 3,583
06-04-18 조회 4,600
06-04-14 조회 5,256
06-03-27 조회 3,883
06-03-06 조회 3,881
06-03-05 조회 5,196
06-02-24 조회 3,821
06-02-23 조회 4,228
06-02-22 조회 4,054
06-02-22 조회 3,356
06-01-15 조회 3,706
06-01-10 조회 3,674
06-01-05 조회 4,892
05-12-30 조회 5,596
05-12-23 조회 3,738
05-12-01 조회 3,443
05-09-29 조회 4,556
05-09-27 조회 4,941
05-09-22 조회 6,168
05-09-15 조회 3,120
05-09-08 조회 3,975
05-09-05 조회 5,686
05-09-01 조회 4,756
05-09-01 조회 5,888
05-08-21 조회 3,339
05-08-18 조회 3,690
05-08-17 조회 3,793