瀏覽代碼

connect to json dynamically

huai-sian 3 年之前
父節點
當前提交
c3fa801333
共有 3 個文件被更改,包括 14 次插入8 次删除
  1. 5 5
      columns.js
  2. 2 3
      goto.js
  3. 7 0
      json/Columns-1043.json

+ 5 - 5
columns.js

@@ -7,16 +7,16 @@ $(document).on("click", ".likeSee__state__filter--item", function (event) {
     $(this).addClass("active");
 });
 
-
+const urlParams = new URLSearchParams(window.location.search);
+let id = urlParams.get('cid');
+console.log(id);
 
 function get_data() {
     $.ajax({
         method: "GET",
-        // url: `json/cases-${id}.json`,
-        // url: `json/cases-${id}.json`,
-        url:`json/Columns.json`,
+        url: `json/Columns-${id}.json`,
+        // url:`json/Columns.json`,
         dataType: "json",
-
     })
 
     .done(function (msg) {

+ 2 - 3
goto.js

@@ -28,9 +28,8 @@ function get_data() {
     // $("#version").html(desid);
     $.ajax({
         method: "GET",
-        // url: `json/cases-${id}.json`,
-        // url: `json/cases-${id}.json`,
-        url:`json/cases.json`,
+        url: `json/cases-${id}.json`,
+        // url:`json/cases.json`,
         dataType: "json",
     })
         .done(function (msg) {

File diff suppressed because it is too large
+ 7 - 0
json/Columns-1043.json


Some files were not shown because too many files changed in this diff