Embedding Html page inside another Html page without using iFrames

不问归期 提交于 2020-01-24 12:26:07

问题


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>
</iframe>

Please advise. Thank you.


回答1:


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.




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/6590981/embedding-html-page-inside-another-html-page-without-using-iframes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!