하나의 링크로 두 개의 프레임 변경
// 자바 스크립트 부분
function moveToURL(){
parent.left.location.href='menu.jsp';
parent.center.location.href="content.jsp";
//parent : FrameSet
//left or center : 프레임의 이름
}
//html 부분의 링크에서 moveToURL()호출
<input type="button" value="확인" onclick="moveToURL()">
------------------------------------------
페이지 내에 iFrame을 만들었을 경우
function moveToURL(){
document.frames.center1.location.href='1.jsp';
document.frames.center2.location.href="2.jsp";
}
// iFrame 부분
<iframe src="" name="center1" width="500" height="400"></iframe>
<iframe src="" name="center2" width="500" height="400"></iframe>
//html 부분의 링크에서 moveToURL()호출
<input type="button" value="확인" onclick="moveToURL()">
덧글