Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript WordPress Ajax with MailChimp for WordPress plugin

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #251321
    rolandas
    Participant

    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 :)

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.