$(document).ready(function(){$("#helpful").on("click",function(){var e=$("#helpful_total").text();$.ajaxSetup({headers:{"X-CSRF-Token":$('input[name="_token"]').val()}});var t=0;$('input[name="helpful"]').is(":checked")&&(t=1);var l={id:$('input[name="tips_and_trick_id"]').val(),slug:$('input[name="slug"]').val(),helpful:t};$.ajax({url:$('input[name="helpful_send_url"]').val(),type:"POST",data:l,beforeSend:function(){$(".helpful_total").text("counting...")},success:function(t){t.status?$(".helpful_total").text(t.data.content.helpful):$(".helpful_total").text(e)},error:function(){$("#helpful").prop("checked",!1),$(".helpful_total").text(e),alert("Internal server error")}})})});