1$(document).ready(function() { 2 $("#signup-form").submit(function(e){ 3 e.preventDefault(); 4 5 var $form = $(this), 6 name = $form.find('input[name="name"]').val(), 7 email = $form.find('input[name="email"]').val(), 8 url = $form.attr('action'); 9 10 $.post(url, {name:name, email:email}, 11 function(data) { 12 if(data) 13 { 14 if(data=="Some fields are missing.") 15 { 16 $("#status").text("Please fill in your name and email."); 17 $("#status").css("color", "red"); 18 } 19 else if(data=="Invalid email address.") 20 { 21 $("#status").text("Your email address is invalid."); 22 $("#status").css("color", "red"); 23 } 24 else if(data=="Invalid list ID.") 25 { 26 $("#status").text("Your list ID is invalid."); 27 $("#status").css("color", "red"); 28 } 29 else if(data=="Already subscribed.") 30 { 31 $("#status").text("You're already subscribed!"); 32 $("#status").css("color", "red"); 33 } 34 else 35 { 36 $("#status").text("You're subscribed!"); 37 $("#status").css("color", "green"); 38 } 39 } 40 else 41 { 42 alert("Sorry, unable to subscribe. Please try again later!"); 43 } 44 } 45 ); 46 }); 47 $("#signup-form").keypress(function(e) { 48 if(e.keyCode == 13) { 49 e.preventDefault(); 50 $(this).submit(); 51 } 52 }); 53 $("#submit-btn").click(function(e){ 54 e.preventDefault(); 55 $("#signup-form").submit(); 56 }); 57});
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.