1jQuery(function($){ 2 3 function validateEmail(email) { 4 var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 5 return re.test(email); 6 } 7 8 $('.revue-subscribe button').click(function() { 9 var container = $(this).parent(); 10 var $fldEmail = $('input[name="revue_email"]', container); 11 12 var $fldFirstName = $('input[name="revue_first_name"]', container); 13 var $fldLastName = $('input[name="revue_last_name"]', container); 14 15 var email = $fldEmail.val(); 16 var firstName = $fldFirstName.val(); 17 var lastName = $fldLastName.val(); 18 19 if (!validateEmail(email)) { 20 $fldEmail.css('border', '1px solid red'); 21 return; 22 } 23 24 var data = { 25 action : 'revue_subscribe', 26 email : email, 27 first_name : firstName, 28 last_name : lastName, 29 }; 30 31 $.post(revue_ajaxurl, data, function(res) { 32 container.html(res.thank_you); 33 }); 34 }); 35});
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.