繁体   English   中英

在 jQuery Ajax `success:` 后显示成功消息并重新加载

[英]Display Success Message After jQuery Ajax `success:` and reload

我想在成功的 Ajax 调用和页面重新加载后立即显示引导警报消息

success: function(res) {
     window.location.reload();
     $('#success').html('<div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>Row Deleted Successfuly</div>');
},
success: function(res) {
//this will display your success message
$('#success').html('<div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>Row Deleted Successfuly</div>');

//then
setTimeout(function(){ window.location.reload(); },5000); //reload a page after 5 seconds

},

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM