Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).ready(function ($)
- {
- $('.subscribe-form').on('submit', function (e)
- {
- e.preventDefault();
- var $el = $(this);
- var loading = '<p><img src="' + WPMailjet.loadingImg + '" alt="Please wait..."></p>';// Loading state
- var $res = $el.parent().find(".response").html(loading);// Clear previous messages
- $.post(WPMailjet.ajaxurl, $el.serialize(), function (data)
- {
- $res.html(data);
- });
- });
- $('.widget-control-close').on('click', function (e)
- {
- var $res = $(this).closest('form').find(".mailjet_subscribe_response");
- if (jQuery.type($res.html()) !== undefined)
- {
- $res.hide();
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement