PHP Classes

File: github/js/script.js

Recommend this page to a friend!
  Classes of Hillary Kollan   My WordPress Plugin List   github/js/script.js   Download  
File: github/js/script.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: My WordPress Plugin List
WordPress plugins for several purposes
Author: By
Last change:
Date: 1 year ago
Size: 1,020 bytes
 

Contents

Class file image Download
jQuery(document).ready(function($){ $('#subscriber-form').submit(function(e){ e.preventDefault(); //serialize FormData var subscriberData = $('#subscriber-form').serialize(); //submit form $.ajax({ type: "post", url: $('#subscriber-form').attr('action'), data: subscriberData }).done(function(response){ $('.form-msg').removeClass('error'); $('.form-msg').addClass('success'); //set response $('.form-msg').text(response); //clear fields $("#name").val(''); $('#email').val(''); }).fail(function(data){ $('.form-msg').removeClass('success'); $('.form-msg').addClass('error'); if(data.responseText !== ""){ $('.form-msg').text(data.responseText); }else{ $('.form-msg').text("Something went wrong"); } }); }); });