Hi all,
I’m trying to display response from MailChimp for WordPress plugin in a modal. I have to use ajax to achieve this, but I’m not sure how to do that.
I’m very new to ajax.
$('#mc4wp-form-1').on('submit', function( evt ){
evt.preventDefault();
var linkToPost = window.location.href;
$.ajax(linkToPost, {
method: "POST",
success: function ( resp ) {
//get modal to open
jQuery('#popmake-855').popmake('open');
//get response from this: .mc4wp-response
//put response in here: .pum-content
},
error: function () {
alert('Something went wrong');
}
});
});
I got stuck with this piece of code :)
Forgot to mention that for modal I’m using Popup Maker WP plugin.
Thanks :)