gpt4 book ai didi

javascript - JavaScript 中的自定义消息框

转载 作者:太空宇宙 更新时间:2023-11-04 12:28:30 25 4
gpt4 key购买 nike

我正在考虑用 JavaScript 制作自定义消息框,但想知道我该怎么做。下面的代码显示了是、否、取消消息框:

 msls.showMessageBox("Please choose the appropriate button", {
title: "This is a message box",

buttons: msls.MessageBoxButtons.yesNoCancel

}).then(function(result) {

if (result === msls.MessageBoxResult.yes) {

alert("You have selected Morning");

} else if (result === msls.MessageBoxResult.no) {

alert("You Have Selected Afternoon");

} else if (result === msls.MessageBoxResult.cancel) {

alert("You have closed this message box");

}

});
}

我的目标是重命名按钮文本,但我不确定该怎么做,下面是我的意思的示例:

  • 早上好
  • 下午
  • 取消取消

我知道如何更改每个按钮的功能,这只是编辑按钮内文本的一小部分,以表达我想要的内容,感谢您的帮助

我使用 Lightswitch HTML 并且在 jquery.mobile.structure-1.3.0.css 文件中引用了消息框 enter image description here

最佳答案

如果您使用的是 msls.ShowMessageBox API,则无法更改按钮的文本。在 LightSwitch 中推荐的方法是使用 Popup。

Creating a Popup Screen in LightSwitch

关于javascript - JavaScript 中的自定义消息框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27844527/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com