且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

嵌入没有 iframe 的外部页面?

更新时间:2023-12-05 19:17:46

您可以使用 jquery 加载外部页面:

<script>$("#testLoad").load("http://www.somesite.com/somepage.html");</script><div id="testLoad"></div>//这有帮助吗

Is there any way to embed an external web page without using an iframe? I have access to both sites, I just want the page that the content is embedded on to resize based on the content that is embedded (it will change over time, and be on multiple sites).

Thanks!

EDIT: I don't think any kind of AJAX would work because it's cross-site, and JavaScript doesn't let you load off-site content (as far as I'm aware).

You could load the external page with jquery:

<script>$("#testLoad").load("http://www.somesite.com/somepage.html");</script>
<div id="testLoad"></div>
//would this help