[英]How can I open a modal window after successful AJAX call?
try to define in call back of success field in ajax
$.ajax({
url: "demo_test.txt",
success: function(result){
$('#my-modal').modal();
},
error: function(){
console.log("Something went wrong");
}
});
success: function(result){
$("yourmodel").animatedModal();
}
$("#yourmodalidgoeshere").animatedModal();
//triggers opening of Modal.
$("#yourmodalidgoeshere").click();
click() 有助于触发模态。 它对我有用。 它没有尝试使用 ajax 调用。 我想在单击元素时加载模态。 在 javascript 函数中,我使用了上面几行,并且运行良好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.