How to send ajax success response to jQuery Modal ( jQuery Modal Site ) when i click submit and automatically show modal with response. This is my ajax to post:
$('#rincian').submit(function() {
$.ajax({
data: $(this).serializeArray(),
type: $(this).attr('method'),
url: $(this).attr('action'),
success: function(response) {
$('#rinci').html(response);
}
});
return false;
});
UPDATE Answered by Jossef
I have changed it to $('#rinci').html(response).modal();
$('#rincian').submit(function() {
$.ajax({
data: $(this).serializeArray(),
type: $(this).attr('method'),
url: $(this).attr('action'),
success: function(response) {
$('#rinci').html(response).modal();
}
});
return false;
});
$('#clickme').click(function() {
$.ajax({
url: '',
success: function(response) {
$('#modal-div').html(response).modal();
}
});
});
add .modal();
and it should work
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.