google-apps-script - 带有链接的消息框
问题描述
我正在尝试popup a message box
在带有文本和clickable hyperlink
.
到目前为止,我的搜索产生了已弃用的 ui 功能。
解决方案
function msgBoxWithLink(msg,link,desc) {
var link=link || 'http://jimesteban.com';
var desc=desc || 'Description';
var msg=msg || 'Link';
var html=Utilities.formatString('<style>input{margin: 5px 0;}</style><h3>%s</h3><a href="%s" target="_blank">%s</a><br /><input type="button" value="Close" onClick="google.script.host.close();" />',msg,link,desc);
var userInterface=HtmlService.createHtmlOutput(html);
SpreadsheetApp.getUi().showModelessDialog(userInterface, "Message Box with Link");
}
推荐阅读
- amazon-web-services - 查询以查找给定行或空行的第一个条目
- android - ViewPager 中 Fragment 中的 OptionsMenu 在显示子 DialogFragment 后冻结
- c - 添加两个结构数组的元素 C
- php - Logic error with Datetime->modify in Symfony entity
- php - Finding duplicates and appending arrays to an array with millions of arrays
- angular - Angular: Multiple nested FormGroups in Component
- oracle - PL/SQL如何调用这个函数
- python - 两个连接的两个数据框如何只有一个相同的列
- json - 如何使用超链接 C# 从复杂的 json 中获取价值
- swift - Firestore 数据库 - 文档未在集合中返回