Skip to content

Commit

Permalink
Reading from Static File
Browse files Browse the repository at this point in the history
  • Loading branch information
NoFoolLikeOne authored Apr 27, 2024
1 parent ec98ddf commit 41a6f53
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,23 @@ <h1>Galactic Mapping Project</h1>

}

function getSignalEntries(){
$("#result").text("Searching")
console.log("fetching url")
fetch(encodeURI('https://us-central1-canonn-api-236217.cloudfunctions.net/gmp'))
.then(response => response.json())
.then(json => updateEntries(json))
;
}
function getSignalEntries() {
$("#result").text("Searching");

const reader = new FileReader();

reader.onload = function(event) {
const fileContent = event.target.result;

// Assuming your file contains JSON data
const json = JSON.parse(fileContent);

// Call your updateEntries function with the parsed JSON data
updateEntries(json);
};

reader.readAsText("json-edd.json");
}

function submitform(){
var data = $(this).serializeArray();
Expand Down

0 comments on commit 41a6f53

Please sign in to comment.