-1
두 개의 iframe이있는 색인 페이지가 있습니다. 내가 맨 iframe에 특정 사업부를 변경하려는 제출에 대한 몇 가지 메시지를 입력 한 경우, 바닥은 iframe입니다 type.php에서 지금다른 하나의 iframe의 DIV 액세스 - jQuery
<iframe name="disp" id="dispframe" src="disp.php"></iframe>
<iframe name="type" id="msgframe" src="type.php"></iframe>
.
가 나는 사용하여 새로 고침 달성 할 수있다 (기본적으로 다른 파일에서 내용을 새로 고침) :
<script type="text/javascript">
parent.disp.location='disp.php'
</script>
(새로 고침시와 때마다, 즉 DIV에 대한 새로운 내용이 페치)하지만 난 단지 사업부를 변경하려면 disp.php에서 (id = "loaddiv"라고 말하면). 내가 disp.php 자체 내에서 그것을 할 수 있었다면,이 같은 것을 사용하는 것이 :
$('#loaddiv').load('newdisp.php');
지금 나는 다른 iframe을에서 loaddiv에 액세스하려는. 나는 일하지 못한 것들을 시도했다.
$("#dispframe", parent).contents().find("#loaddiv").load("newdisp.php");
나는 어딘가 잘못 알고 있습니다. 아무도 올바른 DOM 탐색 방법을 도울 수 있습니까?
이 질문에 대한 답변이 유용 할 것입니다. http://stackoverflow.com/questions/364952/jquery-javascript-accessing-contents-of-an-iframe – sathishkumar
다른 iframe에서 한 iframe의 내용에 액세스하고 싶습니다. 상위 요소의 iframe 내용 만이 아닙니다. 이 iframe에서 형제 iframe에 어떻게 액세스합니까? –