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>
링크의 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>
게시판 목록
개발자팁
개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 266 | 기타 |
|
20년 전 | 2907 | |
| 265 | JavaScript |
|
20년 전 | 3464 | |
| 264 | 기타 |
|
20년 전 | 4627 | |
| 263 | 기타 |
|
20년 전 | 3792 | |
| 262 | 기타 |
|
20년 전 | 5729 | |
| 261 | 기타 | 20년 전 | 4468 | ||
| 260 | 기타 |
|
20년 전 | 3913 | |
| 259 | JavaScript |
|
20년 전 | 18474 | |
| 258 | Flash | 20년 전 | 7685 | ||
| 257 | 기타 | 20년 전 | 4136 | ||
| 256 | 기타 |
|
20년 전 | 6914 | |
| 255 | 기타 | 20년 전 | 3854 | ||
| 254 | 기타 | 20년 전 | 4115 | ||
| 253 | 기타 | 20년 전 | 3626 | ||
| 252 | 기타 | 20년 전 | 4052 | ||
| 251 | 기타 | 20년 전 | 4028 | ||
| 250 | 기타 | 20년 전 | 3768 | ||
| 249 | JavaScript | 20년 전 | 3882 | ||
| 248 | 기타 | 20년 전 | 4271 | ||
| 247 | 기타 | 20년 전 | 5046 | ||
| 246 | JavaScript |
|
20년 전 | 5203 | |
| 245 | PHP | 20년 전 | 5481 | ||
| 244 | Flash |
허저비
|
20년 전 | 7576 | |
| 243 | 기타 |
|
20년 전 | 8146 | |
| 242 | JavaScript | 20년 전 | 5370 | ||
| 241 | JavaScript | 20년 전 | 4577 | ||
| 240 | 기타 | 20년 전 | 5004 | ||
| 239 | 기타 | 20년 전 | 3084 | ||
| 238 | 기타 | 20년 전 | 2854 | ||
| 237 | 기타 | 20년 전 | 4425 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기