티스토리 뷰
요즘 아이프레임을 잘 쓰지 않지만
css 프레임워크를 두가지 합쳐서 써야하는 상황이 생겨버렸다.
css가 자꾸 충돌나서 임시방편으로 iframe을 사용해서 나눴는데.
아이프레임 안의 form에서 submit을 할 경우 아이프레임 안에서 창이 리프레시되면서 기본레이아웃 안에 레이아웃이 또 생겼다.
아래 코드는 아이프레임안의 form 에서 submit을 했을때, submit 이후의 페이지 전환이 부모창에서 되도록 하는 코드.
---------------------
부모창
<iframe src="URL"></iframe>
------
아이프레임 내부
<form class="form-horizontal" name="content_form" method="post" onkeydown="return captureReturnKey(event)">
<button type="submit" class="btn btn-default" onClick="checkForm()" onsubmit="return true;">저장하기</button>
</form>
<script>
// iframe parent window
function checkForm(){
document.content_form.target="_parent";
document.content_form.submit();
}
</script>
'개발' 카테고리의 다른 글
[Leaflet - GeoServer] WMS layer 로 GIS 지도 퍼블리싱하기 (0) | 2020.10.22 |
---|---|
디지털오션 워드프레스에 HTTPS를 위한 SSL 인증서 설치하고 자동갱신 (auto renew)하기 (0) | 2020.08.25 |
No module named google.appengine.api 해결 방법 및 bash_profile 생성하기 (0) | 2017.06.03 |
Command "python setup.py egg_info" failed with error code 1 in ~~ 에러 (0) | 2017.06.03 |
Homebrew, python2.7 파이썬 설치하기 (0) | 2017.06.03 |
댓글