Include a webpage inside a div
Nope. You can't embed a complete HTML document inside another div element as this is a block level element and W3C has defined what could be included inside it.
But there is a workaround. Follow these steps:
- Get the document using ajax (jQuery rocks, use that)
- Extract the content of the
<body>
element and put it inside yourdiv
element - Get all links and script of
<head>
element and append them to the<head>
element of your existing pgae.
Try using an <object>
element:
<div style="margin: 0 auto; width:100%; height:400px;">
<object type="text/html" data="**URL to page**"
style="width:100%; height:100%; margin:1%;">
</object>
</div>