【问题标题】:How to display action result of iframe in parent window如何在父窗口中显示 iframe 的操作结果
【发布时间】:2013-02-16 22:20:21
【问题描述】:

我有一个 html 页面。 html 页面有一个 iframe。 当我在 iframe 中提交表单时,返回的结果会显示在该 iframe 中。 如何在 iframe 的父级中显示该结果??

【问题讨论】:

    标签: html iframe forms html-frames


    【解决方案1】:
       <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 收到服务器的响应时触发此事件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-10-01
      • 2012-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多