DawnC commited on
Commit
1a9eea9
·
1 Parent(s): 5ee548e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -514,20 +514,21 @@ async def predict(image):
514
 
515
  <script>
516
  document.querySelectorAll('button[id^="Dog"]').forEach(button => {
517
- console.log('Attaching event to button: ' + button.id); // 檢查每個按鈕是否正確被生成
518
  button.addEventListener('click', () => {
519
  const button_id = button.id;
520
- console.log('Button clicked: ' + button_id); // 檢查是否觸發了按鈕點擊事件
521
  const radio = document.querySelector('input[type=radio][value="' + button_id + '"]');
522
  if (radio) {
523
  radio.click();
524
- console.log('Radio button clicked for: ' + button_id); // 檢查是否找到相應的 radio button 並點擊
525
  } else {
526
- console.error("Radio button not found for: " + button_id); // 如果沒有找到 radio,顯示錯誤
527
  }
528
  });
529
  });
530
  </script>
 
531
  """
532
 
533
  initial_state = {
 
514
 
515
  <script>
516
  document.querySelectorAll('button[id^="Dog"]').forEach(button => {
517
+ console.log('Attaching event to button: ' + button.id);
518
  button.addEventListener('click', () => {
519
  const button_id = button.id;
520
+ console.log('Button clicked: ' + button_id);
521
  const radio = document.querySelector('input[type=radio][value="' + button_id + '"]');
522
  if (radio) {
523
  radio.click();
524
+ console.log('Radio button clicked for: ' + button_id);
525
  } else {
526
+ console.error("Radio button not found for: " + button_id);
527
  }
528
  });
529
  });
530
  </script>
531
+
532
  """
533
 
534
  initial_state = {