테스트 사이트 - 개발 중인 베타 버전입니다

자바스크립트로 Ajax 효과내기 입니다.

· 9년 전 · 178

일반 페이지에서 하단에 iframe을 만듭니다.
링크의 target을 iframe 이름으로 지정합니다.
링크의 href에 쓰인 파일은 Javascript로 parent의 element 값들을 수정합니다.

예를 들어서 다음 세 파일을 만들고 p.html을 부릅니다.
c.html============================
<html><body></body></html>
================================

p.html============================
<html><body>
hidden frame에서 form을 만들고
거기서 post한 후
script로  child frame에 데이터 수정하기
<a href=set.php target=aja >set</a>
<p style="border: 1px solid blue;height:20px;" id=content></p>
<iframe name=aja src=c.html height=10 width=300>
</body>
</html>
=================================
set.php============================
<html>
<head>
<script language=JavaScript>

parent.document.all.content.innerText="여기가 바뀌는 부분입니다.";
</script>
</html>  

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

게시글 목록

번호 제목
12413
12412
12411
12410
12407
12406
12405
12404
12403
12402
12401
12400
12399
12398
12397
12396
12395
12394
12393
12392
12391
12390
12389
12388
12387