3
iframe과 양식이 있습니다. 양식의 대상은 iframe입니다. 양식을 제출하면 결과 페이지가 iframe에로드됩니다. 나는 아래의 코드 첨부 : 당신이 인수와 jQuery를 이벤트 메서드를 호출 할 경우 docs say으로Jquery form submit() 콜백이 작동하지 않습니다.
<html>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script type="text/javascript">
function submitForm() {
$("form#testForm").submit(function(){
alert('hii')
});
}
</script>
</head>
<body>
<iframe name="testFrame" id="testFrame" frameborder="1" scrolling="no" width="500" height="200"></iframe>
<form name="testForm" id="testForm" action="http://www.yahoo.com" target="testFrame"> </form>
<button name="testBtn" value="submit" onclick="submitForm();">submit</button>
</body>
</html>
경고가 오지 않아 .... 제발 도와주세요 ...
Thnx outis ... 이제 작동 중 ... :-) – Aneesh
한 가지 더 ...로드 된 페이지의 내용 높이를 어떻게 얻을 수 있습니까? $ ("# iframeName"). contents(). find ("body"). 그것은 0을 제공합니다 ... :( – Aneesh
@Aneesh : 그래서 포럼이 아닌 Q & A 사이트입니다. 새로운 질문은 코멘트가 아닌 새로운 질문으로해야합니다. 코드가 작동하지 않는 이유는 간단합니다. 그 댓글을 허용), 그 iframe 내용이 다른 도메인에있다, 그래서 당신은 할 수 없어. – outis