问题描述
我是一位经验丰富的网页开发人员,因此带Google App脚本的Google Web框架看起来恰到好处。不幸的是,在我撞墙之前我并没有走得太远。这是最大的一个(现在)。
场景:开发一个简单的应用程序来解决我在处理新语言时总是使用的一些编程问题。把每个问题放在一个单独的页面上。将css和javascript放在单独的文件中。
这个工作正常。第一个问题是手段问题的统计意义。我发现他们的初学者模板用于从电子表格中读取数据,修改模板以显示数据,然后从那里开始。 CSS很简单,并包含在文件中。它只需要最初的index.html和code.gs。
但是现在,我想修改index.html来添加链接来调用其他HTML文件,其中的应用程序项目高兴地帮助我补充。我也可以添加更多的.gs文件。太好了,我想。但是我怎么称呼他们呢?一个链接需要一个URL,但我唯一拥有的是该项目。据我所知,无法引用包含在同一个项目中的文件。我可以在其他库中调用函数,但不能在另一个页面上调用函数。 .gs脚本看起来是服务器端代码。我该怎么做和访问客户端JavaScript文件。或CSS文件?
我在您的网站上发现了这一点,但我不知道如何实际使用它。
。
我搜索并搜索了这些问题的答案,真正的工作项目的例子。
感谢您的任何帮助,您可以给我。
请参阅,以获得一个示例,显示如何在Google Apps脚本中使用多个HTML页面。
I'm a fairly seasoned web developer, so the Google Web framework with Google App Scripts looks just right for me. Unfortunately, I don't get very far before I hit a wall. Here is the largest one (right now).
Scenario: Develop a simple app to solve some a few of the programming problems I always use when I approach a new language. Put each problem on a separate page. Put the css and javascript in separate files.
This works fine initially. The first problem is a statistical mean of means problem. I found their starter template for reading data from a spreadsheet, modified the template to show the data, and went from there. CSS was simple and included in the file. It only required the initial index.html and code.gs.
But now, I want to modify index.html to add links to call OTHER HTML files, which the App project cheerfully helps me to add. I can add more .gs files as well. Great, I think. But HOW do I call them? A link requires a URL, but the only one I have is to the project. As far as I can tell, there is no way to reference a file included in the same project. I can call a function in some other library but not on another page of this one. The .gs scripts look to be serverside code. What do I do with and access client side javascript files. Or CSS files?
I found this on your site but I don't have a clue how to actually use it.Use project Javascript and CSS files in a Google Apps Script web app?.
I've searched and searched for answers to these questions and have found very little with a real working project example.
Thanks for any help you can give me.
Refer to this answer for an example showing how to use multiple HTML pages in Google Apps Script.
这篇关于Google App:同一App项目中有多个HTML或脚本文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!