ming před 3 roky
rodič
revize
5daa1e521e
1 změnil soubory, kde provedl 5 přidání a 5 odebrání
  1. 5 5
      index2.html

+ 5 - 5
index2.html

@@ -69,8 +69,8 @@
       <!-- fieldsets -->
       <fieldset>
         <h2 class="fs-title">AI ANCHOR</h2>
-        <h3 id=title class="fs-subtitle">標題</h3>
-        <input type="text" name='t1' class='title_new' value="" placeholder="1" /> <br/>
+        <h3  class="fs-subtitle">標題</h3>
+        <input id=title type="text" name='t1' class='title_new' value="" placeholder="1" /> <br/>
         <h3 class="fs-subtitle">台詞</h3>
         <input type="text" name='t1' class='txtsrc1' value="" placeholder="1" /> <br/>
         <input type="text" name='t2' class='txtsrc2' value="" placeholder="2" /><br/>
@@ -135,14 +135,14 @@
     function load_data(id){
       var title = document.getElementById("title")
       console.log(id)
-      title.innerHTML = loaded_data.find(item => item.id === 4).name
+      title.innerHTML = loaded_data.find(item => item.id === id).name
       var step;
       for (step = 1; step <= 10; step++) {
-        $(".txtsrc"+step).val() ='22213'
+        $(".txtsrc"+step).val(loaded_data.find(item => item.id === id).text_content[step-1]) 
       }
       var step2;
       for (step2 = 1; step2 <= 10; step2++) {
-        $(".imgsrc"+step2).val() ='22213'
+        $(".imgsrc"+step2).val(loaded_data.find(item => item.id === id).image_urls[step-1]) 
       }
       
     }