1jQuery(function($){ 2 $('body').on('click', '.subscribe', function(e) { 3 e.preventDefault(); 4 email = $('#email').val(); 5 if(isEmail(email)) { 6 var data = { 7 'action': 'subscribe_user', 8 'email': email, 9 'security': mc.security 10 }; 11 12 $.post(mc.ajaxurl, data, function(response) { 13 if (response == 200) { 14 $(".error-newsletter").css('color', 'green'); 15 $(".error-newsletter").html('You have subscribed successfully.'); 16 } else { 17 $(".error-newsletter").css('color', 'red'); 18 $(".error-newsletter").html(response); 19 } 20 }); 21 } else { 22 $(".error-newsletter").css('color', 'red'); 23 $(".error-newsletter").html('This is not a valid email.'); 24 } 25 }); 26}); 27 28function isEmail(email) { 29 var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; 30 return regex.test(email); 31}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.