code: function jsonpClient (request) {
      return new PromiseObj(function (resolve) {
  
          var name = request.jsonp || 'callback', callback = request.jsonpCallback || '_jsonp' + Math.random().toString(36).substr(2), body = null, handler, script;
  
          handler = function (ref) {
              var type = ref.type;
  
  
              var status = 0;
  
              if (type === 'load' && body !== null) {
                  status = 200;
              } else if (type === 'error') {
                  status = 500;
              }
  
              if (status && window[callback]) {
                  delete window[callback];
                  document.body.removeChild(script);
              }
  
              resolve(request.respondWith(body, {status: status}));
          };
  
          window[callback] = function (result) {
              body = JSON.stringify(result);
          };
  
          request.abort = function () {
              handler({type: 'abort'});
          };
  
          request.params[name] = callback;
  
          if (request.timeout) {
              setTimeout(request.abort, request.timeout);
          }
  
          script = document.createElement('script');
          script.src = request.getUrl();
          script.type = 'text/javascript';
          script.async = true;
          script.onload = handler;
          script.onerror = handler;
  
          document.body.appendChild(script);
      });
  }
docs: JSONP client (Browser).