在 Google Apps Script 网络应用程序中使用项目 Javascript 和 CSS 文件? [英] Use project Javascript and CSS files in a Google Apps Script web app?

查看:28
本文介绍了在 Google Apps Script 网络应用程序中使用项目 Javascript 和 CSS 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在 Google Apps 脚本中创建一个简单的 HTML 网络应用程序,如下所示:

If I create a simple HTML web app in Google Apps Script, like this:

function doGet() {
    return HtmlService.createHtmlOutputFromFile("index.html");
}

和 index.html 看起来像这样:

and index.html looks like this:

<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<div>Test</div>

是否可以将 JS 和 CSS 文件添加为项目的一部分并使用脚本和链接标签包含它们,或者它们是否必须内联/托管在其他地方?

is it possible to add JS and CSS files as part of the project and include them using script and link tags, or do they have to be inline/hosted elsewhere?

推荐答案

目前,让您的 CSS 和 JS 脚本成为您的 Google Apps 脚本项目的一部分是不可行的.您必须将其托管在其他地方并在模板中指向 URL.

For now, it is not doable to have your CSS and JS script to be part of your Google Apps Script project. You will have to host it somewhere else and point the URL in your template.

这篇关于在 Google Apps Script 网络应用程序中使用项目 Javascript 和 CSS 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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