prashant
prashant

Reputation: 999

How to display action result of iframe in parent window

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??

Upvotes: 1

Views: 2309

Answers (1)

Khanh TO
Khanh TO

Reputation: 48972

   <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.

Upvotes: 2

Related Questions