From dbbe675584d101b7f22c2c26dcea755d0b435da6 Mon Sep 17 00:00:00 2001 From: Bohung Date: Fri, 25 Feb 2022 10:48:47 +0800 Subject: [PATCH] Fix js bug. --- app/assets/javascripts/cancer_predict.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/cancer_predict.js b/app/assets/javascripts/cancer_predict.js index 8946d5a..9ee30a5 100644 --- a/app/assets/javascripts/cancer_predict.js +++ b/app/assets/javascripts/cancer_predict.js @@ -55,8 +55,12 @@ $(document).ready(function(){ return Math.round(Number(num)*(10**Digit))/(10**Digit); }; head_data.done(function(){ - // $('.header-nav').html(head_images.responseJSON['head_images']); - // $('.navbar-brand').html(head_images.responseJSON['title']) + if(head_images.responseJSON['head_images'] != ''){ + $('.header-nav').html(head_images.responseJSON['head_images']); + } + if(head_images.responseJSON['title'] != ''){ + $('.navbar-brand').html(head_images.responseJSON['title']); + } data['danger_texts'] = head_data.responseJSON['danger_texts']; $('head title').text(head_data.responseJSON['page_title']) });