Google Apps脚本:如何在HtmlService中使用js库

时间:2012-12-03 08:13:20

标签: google-apps-script

我正在尝试使用Google Apps脚本在Google网站上制作轮播。此轮播包含可动态更改的文本消息。我使用jquery来实现这个,但是GAS HtmlService api无法评估那个js脚本文件。

我在我的应用程序中使用了http://flexslider.com轮播。但它不起作用。 我也尝试过caja playground但它没有carousel实现js文件。 我将所有必需的js文件上传到谷歌云存储并公开。

 <script type="text/javascript" src="http://commondatastorage.googleapis.com/shCore.js"></script>
 <script type="text/javascript" src="http://commondatastorage.googleapis.com/shBrushXml.js"></script>
<script type="text/javascript" src="http://commondatastorage.googleapis.com/shBrushJScript.js"></script>

 <!-- Optional FlexSlider Additions -->
<script src="http://commondatastorage.googleapis.com/jquery.easing.js"></script>
<script src="http://commondatastorage.googleapis.com/jquery.mousewheel.js"></script>
<script defer src="http://commondatastorage.googleapis.com/demo.js"></script>

有任何建议要实施吗?

1 个答案:

答案 0 :(得分:1)

因为Caja会对脚本进行清理并过滤掉你js中的一些代码。 查看here了解详情。

或者,您可以使用Google Drive Webhost发布轮播,然后使用公开的iFrame小工具将其嵌入Google网站。 在这里查看类似的演示 https://sites.google.com/site/appsdatepicker/test-page-2