code: function getJSON(url){
      url = encodeURI(url);
      var xhr = typeof XMLHttpRequest !== 'undefined' ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
  
      var responseTypeAware = 'responseType' in xhr;
  
      xhr.open('GET', url, true);
      if (responseTypeAware) {
          xhr.responseType = 'json';
      }
  
      var daRequest = new Promise(function(resolve, reject){
          xhr.onreadystatechange = function(){
              var result;
              if (xhr.readyState === 4) {
                  try {
                      result = responseTypeAware ? xhr.response : JSON.parse(xhr.responseText);
                      resolve(result);
                  } catch (e){
                      reject(e);
                  }
              }
          };
      });
  
      xhr.setRequestHeader('Content-type', 'application/json; charset=UTF-8');
      xhr.send();
      return daRequest;
  }
docs: getJSON
  
  @param {String} url - for example http://jsonplaceholder.typicode.com/comments?postId=1
  @return {Promise} the string error is the statuscode