Sfoglia il codice sorgente

connect to json dynamically

huai-sian 3 anni fa
parent
commit
c3fa801333
3 ha cambiato i file con 14 aggiunte e 8 eliminazioni
  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