在表单提交事件上打开 URL - Google 应用程序脚本
Open a URL on Form Submit Event - Google App Script
我使用的是 Serge insas 在此处提供的示例代码:
Google Apps Script to open a URL
我稍微修改了代码,如下所示:
Code.GS
function modalUrl(){
FormApp.getUi()
.showModalDialog(
HtmlService.createHtmlOutputFromFile('openUrl').setHeight(50),
'Opening Whosebug'
)
}
openURL.html
<!DOCTYPE html>
<html>
<head>
<base target="_blank">
<script>
var url1 ='
var winRef = window.open(url1);
winRef ? google.script.host.close() : window.alert('Allow popup to redirect you to '+url1) ;
window.onload=function(){document.getElementById('url').href = url1;}
</script>
</head>
<body>
Kindly allow pop ups</br>
Or <a id='url'>Click here </a>to continue!!!
</body>
</html>
出现的问题是在提交表单后无法访问 FormApp.getUi。
请参阅以下错误:
我使用的是 Serge insas 在此处提供的示例代码: Google Apps Script to open a URL
我稍微修改了代码,如下所示:
Code.GS
function modalUrl(){
FormApp.getUi()
.showModalDialog(
HtmlService.createHtmlOutputFromFile('openUrl').setHeight(50),
'Opening Whosebug'
)
}
openURL.html
<!DOCTYPE html>
<html>
<head>
<base target="_blank">
<script>
var url1 ='
var winRef = window.open(url1);
winRef ? google.script.host.close() : window.alert('Allow popup to redirect you to '+url1) ;
window.onload=function(){document.getElementById('url').href = url1;}
</script>
</head>
<body>
Kindly allow pop ups</br>
Or <a id='url'>Click here </a>to continue!!!
</body>
</html>
出现的问题是在提交表单后无法访问 FormApp.getUi。
请参阅以下错误: