超越iframe [英] Going beyond the iframe

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

问题描述

我试图让一个iframe B与站点A进行通信。
我搜索并搜索了每一个我读到的内容,如果它们是不同的域名(iframe src来自一个子域名)。



我想沟通,因为我的公司在其网页上放有广告,并且需要每X分钟刷新一次。这是正常的,如果它是一个正常的添加,但一些增加扩展。就像我已经添加了300x250开始,然后达到800x300。
我想与iframe通信以了解添加何时会扩展,但它似乎不是一种方法。有没有办法让添加超出iframe的初始大小?

如果添加的是300x250,iframe也会有300x250,但是当add扩展时它会被截断,所以我真的需要让iframe扩展也可以添加的内容超出了iframe的大小。



任何人都知道如何做到这一点,或者有一些教程来展示如何与iframe进行一些基本的交流。注意:有一些网站也提供了一个完全不同的域名,所以如果有人知道如何让它超出iframe,那将是非常好的。

>

谢谢

解决方案

有一种方法可以使用iframe进行跨域通信,在根据内容调整Iframe的大小的答案中进行了介绍。

许多广告公司通过iframe在您的网站上投放横幅,并使用上述答案中概述的技术来确保iframe可以扩展至所需的全部尺寸的广告素材。


I am trying to get an iframe B communicate with site A. I've searched and searched and every thing I read says it's impossible if they are of different domain (the iframe src is coming from a sub domain).

I want to communicate because my company has ads on its page and it needs to refresh them every X minutes. This is ok if it's a normal add, but some adds extend. Like I have adds that start with 300x250 and then get to 800x300. I wanted to communicate to the iframe to know when the add was going to expand but it just doesn't seem to be a way. Is there any way to let the add go beyond the initial size of the iframe?

If the add is 300x250 the iframe will also have 300x250, but when the add expands it get's cut off, so I really need to either get the iframe to expand also or have the add go beyond the size of the iframe.

Anyone know how to do this or have some tutorial that shows how to have some basic communication to an iframe.

Note: There are some websites that also serve adds that have a totally different domain, so it would be great if someone knew how to make it go beyond the iframe.

Thanks

解决方案

There is a way to do cross-domain communication using iframes, described in an answer to Resizing an Iframe based on content.

Many ad-serving companies serve their banners on your site via iframes, and use the technique outlined in the answer above to ensure that the iframe can expand to the full required size of the creative.

这篇关于超越iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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