How to display action result of iframe in parent window

孤者浪人 提交于 2020-01-05 07:37:06

问题


I have a html page. html page has a iframe. when I submit the form inside iframe, returned result is displayed inside that iframe. How to display that result in parent of iframe??


回答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>

All you need to do is handle the onload event of the iframe. This event is triggered when the iframe receives response from the server.



来源:https://stackoverflow.com/questions/14892387/how-to-display-action-result-of-iframe-in-parent-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!