javascript - 如何使用 JavaScript 创建自定义弹出窗口
问题描述
我有一个 SendMail 按钮,单击它会调用 JavaScript 函数。验证后会发出警报消息。但这是我正在使用的默认警报。如何在 JavaScript 中创建自定义警报。
我的 HTML 代码:
<div id ="sendmail" style="display: none;">
<div class="container">
<div style="text-align:right; width:100%; padding:0;">
<button id ="cancel" style='margin-right:16px' class="btn btnprimary btn-lg pull-right" a href="javascript:window.history.back()">Cancel</button>
<button id ="sendMail" style='margin-right:16px' class="btn btn-primary btn-lg pull-right" onclick="sendMail()">SendMail</button>
这是我的 index.js 文件
function sendMail(){
console.log(employee_id);
var employeeid = employee_id;
$.ajax({
url:'http://localhost:8088/JirasTrackingApp/reporter/
Reportees/JiraNames/'+employeeid,
type:'GET',
success: function(Jiranumbers){
alert("Mail is sent successfully"); //here I need to be able to call the customized alert instead of that default alert
},
error: function(Jiranumbers){
alert("Mail is not sent successfully");
}
});
请指教,谢谢。
解决方案
您的问题与此非常相似,我知道您在此查询中得到了答案。 如何更改警告框的样式
推荐阅读
- r - 获取与 R 中 data.table 中的条件匹配的最后一行
- python - 使用 Visual Studio 在 azure 上部署 python 烧瓶项目
- java - 在 JavaFX 中切换菜单项
- r - 如何对分类栅格进行 ssplot 或 ggplot
- android - 保存到内部存储的数据是否会在 Android Studio 中连续运行时持续存在?
- scala - 什么时候进行类型检查以进行理解?
- java - 使用 gremlin 驱动程序实现负载平衡
- xml - 如何在 MarkLogic App Builder 中配置构面?
- python - Python 相同的导入适用于某些类而不适用于其他类 - 同一目录中的导入器
- java - 如何使这个平均位置?