【发布时间】:2017-10-04 21:39:21
【问题描述】:
我对节省空间和实时编辑代码感到好奇。谷歌文档不占用任何空间,所以我很想知道它是否可能,并且可能会有颜色代码谷歌文档的扩展?我不想说我知道这是一种很时髦的方法,但我很想知道这是否可能。
我想象它的工作方式是这样的: Google doc 如果查看文档,您会看到它被命名为“script.js”,并且里面的文本正在打印 hello world。 那么在 html 页面中,它可能类似于
<script type=text/javascript src="https://docs.google.com/document/d/1-SCNoJSQlMGJh-hmBLIwlyh_4eM9IisJqspARMMNKg0?plaintext"></script>
(或纯html)
老实说,我不知道如何做到这一点的语法是什么,但我希望我能明白这一点。
然后对于Google sheets,可能是这样的
<script type=text/javascript src="https://docs.google.com/spreadsheets/d/1-cUUw0KJ8k87hTrPWhERRNyr8r-_hZn5tW5sbPsSiLc?plaintext&c=a&r=1"></script>
这将从 Google 表格中检索“hello world”。
您也可以在主 html 页面中执行此操作:
<script type="text/javascript">
var sheet = "https://docs.google.com/spreadsheets/d/1-cUUw0KJ8k87hTrPWhERRNyr8r-_hZn5tW5sbPsSiLc"
// then getting the spot (c,4) where column is "c", and row is "r".
Document.write(sheet+"?c=c&r=4");
</script>
有什么想法吗?
【问题讨论】:
标签: javascript html google-sheets google-docs