我们可以编辑 Google Apps 脚本中使用的 Windows 警报框的标题吗?

阿克斯

我们可以为使用 google apps 脚本创建的 webapp 自定义警报框中的标题吗?

在此处输入图像描述

function confirmReserve(text){
  document.body.style.cursor = 'auto';
  console.log('text = '+text);
  alert(text);
}
凯西

出于安全原因,无法更改警报标题,以让用户知道是谁在发送警报并避免可能的网络钓鱼。

您可以使用模态框来显示您想要的消息。举个例子:

HTML:

<!DOCTYPE html>
<html>

<head>
  <base target="_top">
</head>

<body>
  <button id="myBtn">Open Modal</button>
  <div style="display: none" id="myModal" class="modal">
    <div class="modal-content">
      <span class="close">&times;</span>
      <p>Some text in the Modal..</p>
    </div>
  </div>
</body>
<script>
var modal = document.getElementById("myModal");
var btn = document.getElementById("myBtn");
var span = document.getElementsByClassName("close")[0];
btn.onclick = function() {
  modal.style.display = "block";
}
span.onclick = function() {
  modal.style.display = "none";
}
window.onclick = function(event) {
  if (event.target == modal) {
    modal.style.display = "none";
  }
}
</script>

</html>

然后,您可以使用 CSS 将模式样式设置为警报。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

我们可以从Google Apps脚本访问DataStore吗?

我可以在Google Apps脚本库中使用Class对象吗?

我们可以使用 Google Workspace 帐户登录 windows10 PC 和 Mac 吗

可以在GAS(Google Apps脚本)中使用Bootstrap.js吗?

如何在Google Apps脚本的警报/提示对话框中使用换行符?

我可以阻止具有编辑权限的人修改我的Google Apps脚本吗?

我可以在Google Apps脚本中使用HTML5网络工作者吗?

我可以在带有ES6(V8)的库中的Google Apps脚本中使用定义的类吗?

我们可以在Google App Engine应用程序中使用AsyncHttpClient吗

我们可以在Google网站/应用程序之外使用Google App脚本吗?有什么方法可以从我们的服务器使用google app脚本命令吗?

在Google Apps脚本中使用Google字体

我们可以在Spreadsheet的Google应用脚本中将函数“显示公式”调用吗

我可以在Google Apps脚本中隐藏日志消息吗?

我们可以使用“文件权限”来编辑/创建文件吗?

在Google Apps脚本中使用slices setoption

无法在Google Apps脚本中使用fetchURL()

Google Apps脚本:在公式中使用Var?

我们可以使用Java代码执行Windows Azure PowerShell吗

我们可以使用appium doctor验证Windows上的设置吗?

我们可以使用Windows 7 Home Premium工作吗?

我们可以使用 GCP composer 与 windows 实例通信吗?

Elasticsearch内联脚本:我们可以在“ params”中使用ctx._source字段吗

我们可以在批处理脚本中使用更多颜色吗?

我们可以使用类作为标题吗

我们可以在离线模式下使用Google的“融合位置”服务吗?

我们可以仅使用代码在 Google Cloud 中部署整个项目吗?

我们可以在没有OAuth的情况下使用Google youtube数据API吗?

我们可以将 Azkaban 与 Google Cloud Bigtable 一起使用吗?

我们可以使用 Google Analytics 跟踪单个用户的屏幕信息吗?