code: function loadExternalFile(url, data, callback, errorCallback) {
      // Set up an asynchronous request
      const request = new XMLHttpRequest();
      request.open('GET', url, true);
  
      // Hook the event that gets called as the request progresses
      request.onreadystatechange = () => {
          // If the request is "DONE" (completed or failed)
          if (request.readyState == 4) {
              // If we got HTTP status 200 (OK)
              if (request.status == 200) {
                  callback(request.responseText, data)
              } else { // Failed
                  errorCallback(url);
              }
          }
      };
  
      request.send(null);    
  }
docs: Convenient function