瀏覽代碼

alert json

ming 3 年之前
父節點
當前提交
58bb58a3bb
共有 1 個文件被更改,包括 22 次插入20 次删除
  1. 22 20
      api/static/script_util.js

+ 22 - 20
api/static/script_util.js

@@ -21,31 +21,33 @@ function get_script() {
     }};
   var data = `{"name_hash": `+name_hash+`}`;
   xhr.send(data);
-}
-get_script();
 
-var srcInput = document.querySelector(".msrcParent");
-for (step = 0; step < dataArr.length; step++) {
-  console.log(dataArr[step])
-  var pdiv = document.createElement('div');
-  pdiv.classList.add('subtitle-inputs')
-  
+  var srcInput = document.querySelector(".msrcParent");
+  for (step = 0; step < dataArr.length; step++) {
+    console.log(dataArr[step])
+    var pdiv = document.createElement('div');
+    pdiv.classList.add('subtitle-inputs')
+    
 
-  var rawSrc = document.createElement("input");
-  rawSrc.setAttribute('type', 'text');
-  rawSrc.value = dataArr[step];
-  rawSrc.style.width = "47%";
+    var rawSrc = document.createElement("input");
+    rawSrc.setAttribute('type', 'text');
+    rawSrc.value = dataArr[step];
+    rawSrc.style.width = "47%";
 
-  var mSrc = document.createElement("input");
-  mSrc.setAttribute('type', 'text');
-  mSrc.setAttribute('id', `s${step }`);
-  mSrc.style.width = "47%";
-  pdiv.appendChild(rawSrc)
-  pdiv.appendChild(mSrc)
+    var mSrc = document.createElement("input");
+    mSrc.setAttribute('type', 'text');
+    mSrc.setAttribute('id', `s${step }`);
+    mSrc.style.width = "47%";
+    pdiv.appendChild(rawSrc)
+    pdiv.appendChild(mSrc)
 
-  srcInput.appendChild(pdiv)
-    
+    srcInput.appendChild(pdiv)
+      
+  }
 }
+get_script();
+
+
 
 
 $(".confirmbtn" ).click(function() {