Lately, I've been exploring the capabilities of MyJSON. I attempted to create a function to retrieve data from my database in order to avoid manually typing lengthy text each time I needed it. However, whenever I ran the code, my page would freeze without even executing it. Could this be a bug related to my IDE? For context, I am using repl.it with HTML/CSS/JS.
function submit() {
}
console.log("test test test");
function getJSON() {
console.log("beginning");
var out;
console.log("start");
$.get("https://api.myjson.com/bins/1fsm75", function(data, textStatus, jqXHR) {
var json = JSON.stringify(data);
console.log(json);
out = json;
console.log(out);
});
while(out == undefined) {}
return out;
}
console.log("testarooni");
console.log(getJSON());