D

Ajax 흉내 내기

일반 페이지에서 하단에 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>
=================================<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
|
댓글을 작성하시려면 로그인이 필요합니다.

개발자팁

5,403건

개발과 관련된 유용한 정보를 공유하세요. 질문은 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
정규표현식 06-04-18 조회 4,480
JavaScript 06-04-18 조회 6,097
기타 06-04-18 조회 4,168
Flash 06-04-17 조회 5,592
기타 06-04-17 조회 5,402
JavaScript 06-04-14 조회 5,874
기타 06-04-13 조회 4,750
Flash 06-04-12 조회 3,761
Flash
[Flash]
06-04-11 조회 4,836
Flash 06-04-08 조회 5,518
기타 06-04-03 조회 6,453
기타 06-03-29 조회 3,294
JavaScript 06-03-27 조회 4,216
기타 06-03-25 조회 4,024
MySQL 06-03-23 조회 6,385
기타 06-03-17 조회 4,735
Flash 06-03-17 조회 4,858
Flash 06-03-15 조회 5,337
기타 06-03-14 조회 3,309
JavaScript 06-03-06 조회 4,414
기타 06-03-06 조회 3,817
Flash 06-03-06 조회 6,442
기타 06-03-06 조회 5,176
JavaScript 06-03-05 조회 5,645
기타 06-03-04 조회 4,334
기타 06-03-03 조회 5,283
기타 06-03-01 조회 4,264
JavaScript 06-02-24 조회 4,547
기타 06-02-24 조회 4,515
JavaScript 06-02-23 조회 4,819