리자

타겟(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개

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

프로그램

+
제목 글쓴이 날짜 조회
18년 전 조회 3,647
18년 전 조회 2,075
18년 전 조회 2,013
18년 전 조회 1,548
18년 전 조회 3,881
18년 전 조회 5,884
18년 전 조회 6,981
18년 전 조회 2,460
18년 전 조회 2,705
18년 전 조회 4,162
18년 전 조회 2,167
18년 전 조회 3,613
18년 전 조회 2,868
18년 전 조회 2,725
18년 전 조회 2,195
18년 전 조회 2,459
18년 전 조회 2,588
18년 전 조회 3,082
18년 전 조회 3,726
18년 전 조회 3,266
18년 전 조회 2,773
18년 전 조회 2,266
18년 전 조회 2,935
18년 전 조회 3,024
18년 전 조회 2,535
18년 전 조회 2,291
18년 전 조회 3,325
18년 전 조회 4,845
18년 전 조회 5,063
18년 전 조회 2,287
18년 전 조회 2,181
18년 전 조회 4,991
18년 전 조회 8,954
18년 전 조회 2,040
18년 전 조회 4,917
18년 전 조회 4,357
18년 전 조회 2,600
18년 전 조회 4,954
18년 전 조회 2,782
18년 전 조회 3,662
18년 전 조회 2,614
19년 전 조회 3,427
19년 전 조회 1,938
19년 전 조회 5,368
19년 전 조회 1,686
19년 전 조회 6,046
19년 전 조회 2,865
19년 전 조회 6,030
19년 전 조회 6,825
19년 전 조회 3,717
19년 전 조회 2,196
19년 전 조회 2,090
19년 전 조회 6,887
19년 전 조회 2,387
19년 전 조회 3,940
19년 전 조회 5,327
19년 전 조회 2,673
19년 전 조회 1,728
19년 전 조회 1,565
19년 전 조회 1,511
19년 전 조회 1,786
19년 전 조회 1,779
19년 전 조회 1,772
19년 전 조회 1,708
19년 전 조회 2,500
19년 전 조회 2,302
19년 전 조회 3,459
19년 전 조회 2,586
19년 전 조회 2,566
19년 전 조회 3,406
19년 전 조회 4,621
19년 전 조회 2,957
19년 전 조회 2,796
19년 전 조회 3,343
19년 전 조회 6,276
19년 전 조회 2,178
19년 전 조회 1,982
19년 전 조회 1,934
19년 전 조회 1,995
19년 전 조회 3,184
19년 전 조회 2,255
19년 전 조회 1,945
19년 전 조회 1,620
19년 전 조회 2,071
19년 전 조회 3,355
19년 전 조회 3,223
19년 전 조회 1,900
19년 전 조회 1,473
19년 전 조회 3,169
19년 전 조회 2,045
19년 전 조회 1,611
19년 전 조회 2,831
19년 전 조회 1,959
19년 전 조회 1,833
19년 전 조회 1,808
19년 전 조회 1,774
19년 전 조회 2,198
19년 전 조회 2,616
19년 전 조회 1,775
19년 전 조회 1,513
🐛 버그신고