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

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

问题描述

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

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脚本项目的一部分是不可行的。您必须将其托管到其他位置并将该网址指向您的模板。

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脚本网络应用程序中使用项目Javascript和CSS文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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