From af3c3e6623a4c0f0876d6c9d1b97ec120e8c61d3 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Fri, 26 Mar 2021 17:00:52 -0400 Subject: [PATCH] bypass CORS --- zhetic-poc/js/catalog.js | 2 +- zhetic-poc/js/reader.js | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/zhetic-poc/js/catalog.js b/zhetic-poc/js/catalog.js index b7b938f..137988f 100644 --- a/zhetic-poc/js/catalog.js +++ b/zhetic-poc/js/catalog.js @@ -1,7 +1,7 @@ function load() { $.ajax({ dataType: "json", - url: "https://"+window.location.hostname+"/db.json", + url: "/db.json", headers: { "Accept": "application/json"}, success: function (res) { let strCatalog = ""; diff --git a/zhetic-poc/js/reader.js b/zhetic-poc/js/reader.js index d3f299a..c2b6f45 100644 --- a/zhetic-poc/js/reader.js +++ b/zhetic-poc/js/reader.js @@ -100,9 +100,16 @@ $(document).ready(function () { let domain = window.location.hostname; $.ajax({ dataType: "json", - url: "https://"+domain+"/db.json", + url: "/db.json", headers: { "Accept": "application/json"}, success: function (res) { + $.ajax({ + dataType: "json", + url: "https://"+domain+"/db.json", + headers: { "Accept": "application/json"}, + success: function (res) { + } + }); pageNo = res[id]["pageNo"]; title = res[id]["title"]; cid = res[id]["cid"];