diff --git a/app/assets/javascripts/cancer_predict.js b/app/assets/javascripts/cancer_predict.js index 1272aaf..5ddd4b2 100644 --- a/app/assets/javascripts/cancer_predict.js +++ b/app/assets/javascripts/cancer_predict.js @@ -89,9 +89,9 @@ $(document).ready(function(){ }); $('.cancer_help_btn').off("click").on('click',function(){ var modal_head = ""; - try{ modal_head = $(this).parent().find(">label").html()}catch{}; + try{ modal_head = $(this).parent().find(">label").html()}catch(e){}; var modal_body = ""; - try{ modal_body = $(this).parent().find(">input.help_texts").attr('value')}catch{}; + try{ modal_body = $(this).parent().find(">input.help_texts").attr('value')}catch(e){}; $('#show_help_modal').html("") $('#show_help_modal').modal('show'); @@ -141,7 +141,7 @@ $(document).ready(function(){ var input_value = $(this).parent().find('.num_only').data('range')[0]; if(input_value != undefined) $(this).parent().find('.num_only').val(input_value); - }catch{ + }catch(e){ $(this).parent().find('.num_only').val(0); }; if($(this).parent().find('.num_only').val() != ""){ @@ -193,7 +193,7 @@ $(document).ready(function(){ if(input_value != undefined) $(this).parent().find('.num_only').val(input_value); } - }catch{ + }catch(e){ $(this).parent().find('.num_only').val(0); }; if($(this).parent().find('.num_only').val() != ""){ @@ -215,7 +215,7 @@ $(document).ready(function(){ if($('.cancertable_empty').length == 0){ $('#danger_texts').remove(); }; - }catch{}; + }catch(e){}; $(this).addClass('active'); }); $('#cancer_table_reset').click(function(){ @@ -301,7 +301,7 @@ $(document).ready(function(){ $('#result_table_content .cancer_years').off('click').on('click',function(){ try{ $(this).parent().find('.cancer_years').removeClass('active'); - }catch{}; + }catch(e){}; $(this).addClass('active'); $('#current_year').attr('index',$(this).attr('index')); $('#current_year').attr('value',$(this).html()); @@ -319,7 +319,7 @@ $(document).ready(function(){ $('#result_text_content .cancer_years').click(function(){ try{ $(this).parent().find('.cancer_years').removeClass('active'); - }catch{}; + }catch(e){}; $(this).addClass('active'); $('#current_year').attr('value',$(this).html()); $('#current_year').attr('index',$(this).attr('index')); @@ -451,7 +451,7 @@ $(document).ready(function(){ if($('.cancertable_empty').length == 0){ $('#danger_texts').remove(); }; - }catch{}; + }catch(e){}; $(this).addClass('active'); if(!click_flag){ if(!active_treatment.includes($(this).parent().attr('id'))){ @@ -472,7 +472,7 @@ $(document).ready(function(){ if($('.cancertable_empty').length == 0){ $('#danger_texts').remove(); }; - }catch{}; + }catch(e){}; $(this).addClass('active'); if(!click_flag){ if(active_treatment.includes($(this).parent().attr('id'))){ @@ -571,7 +571,7 @@ $(document).ready(function(){ result['age2'] = Math.pow((Number(result_json['age'])/100),0.5)*Math.log(result_json['age']/100); result['size1'] = Math.log(Number(result_json['size'])/10); if(Number(result_json['lymph_nodes_examined']) != 0) - try{result['ratio'] = Number(result_json['lymph_nodes_positive'])/Number(result_json['lymph_nodes_examined'])}catch{result['ratio'] = 0} + try{result['ratio'] = Number(result_json['lymph_nodes_positive'])/Number(result_json['lymph_nodes_examined'])}catch(e){result['ratio'] = 0} else result['ratio'] = 0 if(result['ratio'] > 1) @@ -655,7 +655,7 @@ $(document).ready(function(){ result['lpv'] = ((result['age1']-0.7276655)*(-10.87)+(result['age2']+0.4540707)*8.968+(result['size1']-0.643632)*0.7678+(result['nposit']-1.346932)*0.5339+ result['grade_2']*0.4795+result['grade_3']*0.818+result['subtype_HER2']*0.1806+result['subtype_triple']*0.6457+result['pstage_2']*0.5311+ result['pstage_3']*1.134+result['pstage_4']*2.172+result['lvi_yes']*0.3321-0.04); - }catch{result['lpv'] = "error"}; + }catch(e){result['lpv'] = "error"}; return result; }; function submit_fcn(){