开发者

Embed Page Without iFrame

This may not be possible, but I am looking for a different way to include a full page inside a PHP page. Currently the method I am using is an iframe. For certain reasons we want to move away from the iframed approach and look into alternate methods. The problem is, the iframe provided a nice self-contained environment for the child page.

PHP includes are not viable because the whole path structure is changed on the child when you include it into the parent page, and css/javascript from the parent now effect the child and vice versa. The child contains full html structure and including that开发者_如何学编程 directly inside another page will cause all sorts of wackiness. We also have almost 2000 of these child pages that vary in design, so it's nothing that could be changed with an automated script. Needless to say we don't want to have to touch the child pages.

So my question, is there any way to include a page into another page without using an iframe, while still preserving the child's path structure and not have the two pages conflict with each other (in regards to code/styles/scripts on each). Any tips would help.


You can use Ajax and reset style in the child. Example:

<div id="ajax_container">
    .. Content Loaded by Ajax ..
</div>

div#ajax_container * {
    margin: 0px;
    padding: 0px;
    border: none;
    ...
    font-family: Arial;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜