如何在Iframe中嵌入Google文档集合? [英] How can I embed a Google Docs collection in an Iframe?

查看:498
本文介绍了如何在Iframe中嵌入Google文档集合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Google文档集,我想将其嵌入到iframe中:

I have a Google Docs collection that I would like to embed into an iframe:

https://docs.google.com/open?id=0B6yYgWS-CUJ2ZTUxZGI4MGUtMWM0Yy00YzY0LWIxOTMtMDFlN2RjNDAxNGM2

在这里的问题是Google设置了 X-Frame-Options 标头,因此它们似乎只允许将此集合嵌入到Google网站中:

The problem here is that Google has set the X-Frame-Options header and so it seems they only allow this collection to be embedded into a Google site:

X-Frame-Options:    SAMEORIGIN

screenshot-with-shadow.png http://img580.imageshack.us/ img580 / 4526 / screenshotwithshadow.png

现在我意识到谷歌在某些时候不允许在iframe播放内容的原因,但这是我的一个案例我觉得有能力做到这一点很好。

Now I realize Google's reasons for not allowing their content in iframes some of the time, but this is one case where I feel like it would be nice to have the ability to do this.

有了做谷歌还允许两种方法分享

With documents Google also allows two methods of "sharing"


  1. 你可以点击分享按钮并设置可见性,这将给你一个链接到文档

  2. 或者您可以单击发布到Web,它将为您提供链接或iframe选项。

iframe网址与链接网址类似,不同之处在于它在结尾处有& embedded = true 查询变量。 Google地图也是如此,除了参数是& output = embed

The iframe url is similar to the link URL except that it has the "&embedded=true" query variable at the end. The same thing is true for Google Maps except the parameter is "&output=embed"

我在哪里相信我的网站上的标题或Javascript无法用来加载Google文档集合的iframe内容,我希望有人可能知道为Google文档集合生成嵌入代码的方法它将被加载到iFrame中。

Who while I believe there is nothing I can do with headers or Javascript on my site to allow the content of an iframe for a Google Docs collection to load, I was hoping someone might know of a way to generate embed code for a Google Docs collection which would allow it to be loaded in an iFrame.

推荐答案

更新:Google似乎允许通过iFrame嵌入Google Docs / Drive项目。以下是该页面的当前标题(请注意,此URL位于重定向之后):

Update: It looks like Google has allowed embedding Google Docs/Drive items via iFrame. Here are the current headers for that page (note that this URL is after the redirect):

这篇关于如何在Iframe中嵌入Google文档集合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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