가능한 중복은 :
내가 iframe을에서 (HTML 페이지) 자바 스크립트 함수를 실행해야
Iframe Function Calling From Iframe to parent page javascript functioniframe 내부에서 Javascript 함수를 호출하려면 어떻게해야합니까?
, 나는 내가 온라인의 지침을 따라하지만 만들 수 없습니다 그것은 작동합니다. 어떤 아이디어? 여기
코드입니다 :<html>
<head>
<script type="text/javascript">
function testFunction()
{
var jsmessage = "Test succeed.";
alert(jsmessage);
return false;
}
</script>
</head>
<body>
<iframe id="myframe" src="iframe.html" height="260" width="620" frameborder="0"></iframe>
</body>
</html>
그리고 여기 iframe.html 코드입니다 : 당신이 작동하지 않을 수 있다고 말한다 normally.Why
<html>
<body>
<input type="button" onclick="parent.testFunction();" value="Test function">
</body>
</html>
이 게시물을 확인하십시오 : http://stackoverflow.com/questions/2161388/iframe-function-calling-from-iframe-to-parent-page-javascript-function – kylemac