简体   繁体   English

如何通过根据内容高度调整大小的iframe嵌入窗口小部件

[英]How to embed widget via iframe that resizes according to content height

I have an web page that is a widget and has to be embedded on another website (the domain is not the same) 我有一个网页,它是一个小部件,必须嵌入到另一个网站中(域不相同)

I tried using the iframe approach 我尝试使用iframe方法

This works but the problem is that the height of my page increases according to the height. 这可行,但问题是我页面的高度根据高度而增加。 I cannot use javascript to access the content height because the domain is different and the call is blocked due to cross site scripting. 我无法使用javascript来访问内容高度,因为域不同并且由于跨站点脚本编写而导致呼叫被阻止。

Is there any easy solution available for this problem. 是否有任何简单的解决方案可用于此问题。

one option would be to make a little mini API on the widget side. 一种选择是在小部件侧制作一些微型API。

calculate the height. 计算高度。 and let the other webpage get that information via JASONP(which is basically cross site scripting). 并让其他网页通过JASONP(基本上是跨站点脚本)获得该信息。

heres some info about JASONP What is JSONP all about? 关于JASONP的继承人信息JSONP的全部含义是什么?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM