【发布时间】:2013-02-16 22:20:21
【问题描述】:
我有一个 html 页面。 html 页面有一个 iframe。 当我在 iframe 中提交表单时,返回的结果会显示在该 iframe 中。 如何在 iframe 的父级中显示该结果??
【问题讨论】:
标签: html iframe forms html-frames
我有一个 html 页面。 html 页面有一个 iframe。 当我在 iframe 中提交表单时,返回的结果会显示在该 iframe 中。 如何在 iframe 的父级中显示该结果??
【问题讨论】:
标签: html iframe forms html-frames
<script type="text/javascript">
$(document).ready(function () {
$("#test").load(function (e) {
var htmlFromServer = $(e.target).contents().find("html").html();
});
});
</script>
<iframe id="test" src="HTMLPage1.htm"></iframe>
您需要做的就是处理 iframe 的 onload 事件。当 iframe 收到服务器的响应时触发此事件。
【讨论】: