whole_func_string: function fetch(url) {
  	  var responseType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'text';
  	  return new Promise(function (resolve, reject) {
  	    try {
  	      var request = new XMLHttpRequest(); // Check for CORS support
  
  	      if (!('withCredentials' in request)) {
  	        return;
  	      }
  
  	      request.addEventListener('load', function () {
  	        if (responseType === 'text') {
  	          try {
  	            resolve(JSON.parse(request.responseText));
  	          } catch (e) {
  	            resolve(request.responseText);
  	          }
  	        } else {
  	          resolve(request.response);
  	        }
  	      });
  	      request.addEventListener('error', function () {
  	        throw new Error(request.status);
  	      });
  	      request.open('GET', url, true); // Set the required response type
  
  	      request.responseType = responseType;
  	      request.send();
  	    } catch (e) {
  	      reject(e);
  	    }
  	  });
  	}
func_code_string: function fetch(url) {
  	  var responseType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'text';
  	  return new Promise(function (resolve, reject) {
  	    try {
  	      var request = new XMLHttpRequest(); // Check for CORS support
  
  	      if (!('withCredentials' in request)) {
  	        return;
  	      }
  
  	      request.addEventListener('load', function () {
  	        if (responseType === 'text') {
  	          try {
  	            resolve(JSON.parse(request.responseText));
  	          } catch (e) {
  	            resolve(request.responseText);
  	          }
  	        } else {
  	          resolve(request.response);
  	        }
  	      });
  	      request.addEventListener('error', function () {
  	        throw new Error(request.status);
  	      });
  	      request.open('GET', url, true); // Set the required response type
  
  	      request.responseType = responseType;
  	      request.send();
  	    } catch (e) {
  	      reject(e);
  	    }
  	  });
  	}
func_documentation_string: ========================================================================== Fetch wrapper Using XHR to avoid issues with older browsers ==========================================================================