简体   繁体   English

iframe动态高度取决于

[英]dynamic iframe height depending on

Is there any javascript algo that i can used to check for a website page height and put it as height of the iframe to render the page 有没有可用于检查网站页面高度并将其作为iframe的高度的javascript算法,以呈现页面

step 1 : check what is the height of the website , let say www.cnn.com.my 步骤1:检查网站的高度,比方说www.cnn.com.my
step 2 : get the height , and put in ? 步骤2:取得高度,并放入?
step 3: render the page in iframe with height 'pre-set' 第3步:以“预设”高度在iframe中呈现网页

No, because of the Same-Origin policy, you can only access the properties of a page from the same domain as the current page using JavaScript. 不可以,因为有同源策略,您只能使用JavaScript从与当前页面相同的域中访问页面的属性。 Trying to access the properties of a page from another domain is known as cross-domain scripting and is prohibited by the browser. 尝试从另一个域访问页面的属性称为跨域脚本编写,并且被浏览器禁止。

@cometta:check what is the height of the website> I am sorry. @cometta:检查网站的高度>对不起。 NO. 没有。

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

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