瀏覽代碼

alert json

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

+ 4 - 1
api/static/script_util.js

@@ -17,7 +17,10 @@ function get_script() {
     if (xhr.readyState === 4) {
         console.log(xhr.status);
         console.log(xhr.responseText);
-        dataArr = xhr.responseText.split(',');
+        replaced = xhr.responseText.replace('"','');
+        replaced = replaced.replace('[','');
+        replaced = replaced.replace(']','');
+        dataArr = replaced.split(',');
         putscript();
     }};
   var data = `{"name_hash": `+name_hash+`}`;