使用JavaScript控制Google Docs嵌入式查看器

时间:2016-11-24 12:29:46

标签: google-docs google-slides google-slides-api

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

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

有人做过这样的事吗?

1 个答案:

答案 0 :(得分:0)

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

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个电话。

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

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

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