Skip to content Skip to sidebar Skip to footer

How To Dynamic Load The Document Content Into An Iframe?

I would like to make something like this |--------------------------| | A | | ____________ | | | | | | | |

Solution 1:

You may want to look at an AJAX solution. This way you avoid the iframe and associated complexity. On the A page you can create a div tag with a specific id. Then using AJAX you can load the content of the B page into the div tag.

The HTML that is loaded can then directly be manipulated by the code on your A page since it is essentially one page.

If you are using plain javascript then you will find all the info you need in this tutorial.

If on the other hand you wish to use jQuery then it is as simple as:

  $('#myDiv').load('B.html');

where myDiv is the ID of your div.

Solution 2:

$('#iframeId').contents().find('html').html(yourContent);

Post a Comment for "How To Dynamic Load The Document Content Into An Iframe?"