瀏覽代碼

add log test

ming 3 年之前
父節點
當前提交
abbe7bac49
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      index2.html

+ 4 - 3
index2.html

@@ -135,14 +135,15 @@
     function load_data(id){
       var title = document.getElementById("title")
       console.log(id)
-      title.innerHTML = loaded_data.find(item => item.id === 4).name
+      tid = 4
+      title.innerHTML = loaded_data.find(item => item.id === tid).name
       var step;
       for (step = 1; step <= 10; step++) {
-        $(".txtsrc"+step).val(loaded_data.find(item => item.id === 4).text_content[step-1]) 
+        $(".txtsrc"+step).val(loaded_data.find(item => item.id === tid).text_content[step-1]) 
       }
       var step2;
       for (step2 = 1; step2 <= 10; step2++) {
-        $(".imgsrc"+step2).val(loaded_data.find(item => item.id === 4).image_urls[step-1]) 
+        $(".imgsrc"+step2).val(loaded_data.find(item => item.id === tid).image_urls[step-1]) 
       }
       
     }