bypass CORS

main
BuildTools 4 years ago
parent 9404b85e77
commit af3c3e6623
  1. 2
      zhetic-poc/js/catalog.js
  2. 7
      zhetic-poc/js/reader.js

@ -1,7 +1,7 @@
function load() { function load() {
$.ajax({ $.ajax({
dataType: "json", dataType: "json",
url: "https://"+window.location.hostname+"/db.json", url: "/db.json",
headers: { "Accept": "application/json"}, headers: { "Accept": "application/json"},
success: function (res) { success: function (res) {
let strCatalog = ""; let strCatalog = "";

@ -98,11 +98,18 @@ $(document).ready(function () {
let url = new URL(window.location.href); let url = new URL(window.location.href);
let id = url.searchParams.get("id"); let id = url.searchParams.get("id");
let domain = window.location.hostname; let domain = window.location.hostname;
$.ajax({
dataType: "json",
url: "/db.json",
headers: { "Accept": "application/json"},
success: function (res) {
$.ajax({ $.ajax({
dataType: "json", dataType: "json",
url: "https://"+domain+"/db.json", url: "https://"+domain+"/db.json",
headers: { "Accept": "application/json"}, headers: { "Accept": "application/json"},
success: function (res) { success: function (res) {
}
});
pageNo = res[id]["pageNo"]; pageNo = res[id]["pageNo"];
title = res[id]["title"]; title = res[id]["title"];
cid = res[id]["cid"]; cid = res[id]["cid"];

Loading…
Cancel
Save