Advertisement
Guest User

Untitled

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