1 2 3 4$(function() 5{ 6 function after_form_submitted(data) 7 { 8 if(data.result == 'success') 9 { 10 $('form#reused_form').hide(); 11 $('#success_message').show(); 12 $('#error_message').hide(); 13 } 14 else 15 { 16 $('#error_message').append('<ul></ul>'); 17 18 jQuery.each(data.errors,function(key,val) 19 { 20 $('#error_message ul').append('<li>'+key+':'+val+'</li>'); 21 }); 22 $('#success_message').hide(); 23 $('#error_message').show(); 24 25 //reverse the response on the button 26 $('button[type="button"]', $form).each(function() 27 { 28 $btn = $(this); 29 label = $btn.prop('orig_label'); 30 if(label) 31 { 32 $btn.prop('type','submit' ); 33 $btn.text(label); 34 $btn.prop('orig_label',''); 35 } 36 }); 37 38 }//else 39 } 40 41 $('#reused_form').submit(function(e) 42 { 43 e.preventDefault(); 44 45 $form = $(this); 46 //show some response on the button 47 $('button[type="submit"]', $form).each(function() 48 { 49 $btn = $(this); 50 $btn.prop('type','button' ); 51 $btn.prop('orig_label',$btn.text()); 52 $btn.text('Sending ...'); 53 }); 54 55 56 $.ajax({ 57 type: "POST", 58 url: 'handler.php', 59 data: $form.serialize(), 60 success: after_form_submitted, 61 dataType: 'json' 62 }); 63 64 }); 65}); 66 67 68 69$(function() 70{ 71 $('#captcha_reload').on('click',function(e) 72 { 73 e.preventDefault(); 74 d = new Date(); 75 var src = $("img#captcha_image").attr("src"); 76 src = src.split(/[?#]/)[0]; 77 78 $("img#captcha_image").attr("src", src+'?'+d.getTime()); 79 }); 80});
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.