简体   繁体   English

获取整个iframe内容的大小(不包括滚动条)

[英]Getting the size of an entire iframe contents not including the scrollbars

I am creating a web app where you can QA a website by writing notes and putting alerts on a canvas that will then be saved and sent off. 我正在创建一个Web应用程序,您可以在其中通过写笔记并将警报放在画布上来对网站进行质量检查,然后将其保存并发送出去。 What i need to know is how can i get the entire size of an iframe this means if you have to scroll down i need the size all the way to the bottom of the scroll bar although i do not wish to include the scroll bars. 我需要知道的是如何获取iframe的整个尺寸,这意味着如果您必须向下滚动,尽管我不希望包含滚动条,但我一直需要滚动条底部的尺寸。

This is so i can create a canvas that is the exact same size of the iframe and i can draw on top of it. 这样一来,我可以创建与iframe尺寸完全相同的画布,并且可以在其上面进行绘制。

How would i go about getting this information? 我将如何获取此信息?

using an iframe is not going to allow you to get to the content with javascript when the content is hosted from a different domina. 当内容是从其他域中托管时,使用iframe不会允许您使用javascript来访问内容。

a possible solution would be something like 一个可能的解决方案是

<html>
    <body>
        <object data="http://www.google.com" type="text/html"></object>
    <body>
</html>

not sure if this will work for you but could be a solution. 不知道这是否适合您,但可能是一个解决方案。

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

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