使用JavaScript控制Google Docs嵌入式查看器 [英] Control Google Docs embedded viewer with JavaScript

查看:97
本文介绍了使用JavaScript控制Google Docs嵌入式查看器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要控制网站中嵌入式的Google Docs查看器.更具体地说,我需要能够启用/禁用Google幻灯片视图的控件,并能够使用JavaScript启动/停止演示.

I need to control the embedded Google Docs viewer in my site. More specifically I need to be able to enable/disable the controls for Google Slides view and to be able to start/stop the presentation with JavaScript.

我无法为此找到任何JavaScript API,也无法添加主机,因此我的JavaScript能够与iframe内容进行通信.

I was not able to find any JavaScript API for that, nor I have been able to add my host so my JavaScript to be able to communicate with the iframe content.

有人做过这样的事吗?

推荐答案

Google文档根本无法正常工作.这是您需要采取的步骤.

Google Docs doesn't work like that at all. Here are the steps you will need to take.

1: Create Presentation on Google Slides.
   1a: https://docs.google.com/presentation/u/0/
2: Create any scripts you want applied in the script editor.
   2a: https://developers.google.com/apps-script/guides/slides/
3: Publish Presentation. 
   3a: File>Publish to Web>Embed
4: Embed Presentation.
5: Create HTML Function call
6: Create Listener w/ Google Docs (Not on your site.)

如果您希望自己的网站能够访问和运行来自google的脚本(又称为禁用控件),请参考下面的链接,它将向您展示如何使用HTML请求从google docs运行脚本.请记住,使用Google的免费帐户的日常功能调用受到限制.我认为每天最多可以拨打5500个电话.

If you want your site to be able to access and run scripts from google (Aka, disable controls.) Refer to this link below, it will show you how you can use HTML to request that a script is run from google docs. Keep in mind there is a limitation to daily function calls for free accounts w/ google. I believe it's 5500 calls per day max.

HTML函数调用: https://developers.google.com/apps -script/guides/html/communication

HTML Function Calls: https://developers.google.com/apps-script/guides/html/communication

您还提到了iFrame,您可以在此处找到有关该信息的信息.

You also mentioned iFrame, you can find information about that located here.

iFrame沙箱: https://developers.google.com/apps-script/迁移/iframe

iFrame Sandboxing: https://developers.google.com/apps-script/migration/iframe

这篇关于使用JavaScript控制Google Docs嵌入式查看器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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