Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function load() {
- var actual_JSON;
- var value = function(file, callback) {
- var xobj = new XMLHttpRequest();
- xobj.overrideMimeType("application/json");
- xobj.open('GET', file, false); // Replace 'my_data' with the path to your file
- xobj.onreadystatechange = function () {
- if (xobj.readyState == 4 && xobj.status == "200") {
- // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode
- return callback(xobj.responseText);
- }
- };
- xobj.send(null);
- } ("https://cameraobscura-dot-1-dot-doubleb-automation-production.appspot.com/api/menu", function(result) {actual_JSON = JSON.parse(result);})
- return actual_JSON;
- }
- var result = load();
- console.log("Feel free to use:");
- console.log(result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement