嵌入没有 iframe 的外部页面? [英] Embed an External Page Without an Iframe?

查看:18
本文介绍了嵌入没有 iframe 的外部页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在不使用 iframe 的情况下嵌入外部网页?我可以访问这两个站点,我只希望嵌入内容的页面根据嵌入的内容调整大小(它会随着时间的推移而改变,并在多个站点上).

谢谢!

我认为任何类型的 AJAX 都不起作用,因为它是跨站点的,而且 JavaScript 不允许您加载站外内容(据我所知).

解决方案

您可以使用 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

这篇关于嵌入没有 iframe 的外部页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆