-3

I need to load an html page inside a div in the following pseudo page:

<html>
    <head></head>
    <style>
        body {
            background-color: yellow;
        }
    </style>
    <body>
        <div style="display:none">
            <html>
                <head></head>
                <style>
                    body {
                        background-color: blue;
                    }
                </style>
                <body>
                    <div style="display:none">
                        ...
                    </div>
                </body>
            </html>
        </div>
    </body>
</html>

What naturally happens in this code is that the background will turn blue, as it is being changed in the middle of the page. Is there a way to isolate this div? So it would act similarly to an iframe. The content inside the div is stored in a variable, so I think I cannot use a frame, as the html code is not stored in a file to use it as a source.

Thank you!

2 Answers2

2

You can not load a Site into a Site without an Iframe due to security risks.

The only thing you can do, is to load the external Site with a serverside script like php, cut of the head with regexp and send the rest to your site into your div.

2

This is just wrong. An HTML document can only have one html tag and one body tag, otherwise it will be an invalid document, browsers won't allow it.

If you load an iframe, instead, it will have his own #document and it's fine.

pumpkinzzz
  • 2,907
  • 2
  • 18
  • 32