开发者

Embedding Html page inside another Html page without using iFrames

I ran into an issue where one of my customer's browser does not support iFrames (rather his Outlook does not). Without using iFrames, how can i display another page's content inside Html? Original iFrames insert looked as following:

<iframe src="http://mybox:8081/blah/report.jsp" width="1000" height="420">
<p>Your browser does not support iframes.</p开发者_StackOverflow社区>
</iframe>

Please advise. Thank you.


You cannot without using an iFrame.

Your options are even more limited because you're working with an email client. HTML in email clients are very finicky.


It seems you are using an email client, which definitely doesn't support iFrames, but for reference, you can do this with jQuery on a website.

$(document).ready(function() {
    $(".yourSelector").load("/pages/pageyouwanttoloadhtmlof.html");
});

Please note that .load will strip out scripts in most cases (there are uses that won't), and also note that you cannot load content from different domains than yours. (There are ways around this with things like jsonP, but that gets quite complicated, and you pretty much still have to control both domains.


You can use a DIV to display it, another page content should set using DIV's inner html property

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜