【发布时间】:2021-06-08 14:07:04
【问题描述】:
我正在使用谷歌应用脚本开发一个网络应用,但是在将参数传递给 URL 时它不起作用。
'''
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
/**Some Code here*/
<form id="formsearch" class="col s12" action="<?!=ScriptApp.getService().getUrl()?views=log);?>">
/**Some Code here*/
</form>
</body>
</html>
'''
结果网址:https://script.google.com/macros/s/AKfycbwo0KN6CaTT3v650rtjrAGwVVp17NxnFtcF9Wpp3-CL/dev?
或
与其他尝试: https://script.google.com/macros/s/AKfycbwo0KN6CaTT3v650rtjrAGwVVp17NxnFtcF9Wpp3-CL/devviews=log?
还有其他方法吗? 以及如何解决这个问题?
【问题讨论】:
-
我认为您需要使用加号运算符连接字符串。
ScriptApp.getService().getUrl() + "?views=log" -
我已经尝试过 + 和 concat() 两者,结果 URL 是上面的第二个!
-
action="=ScriptApp.getService().getUrl()+'?views=log';?>">
标签: google-apps-script web-applications