docs: function load (spec, callback) {
      if ((spec instanceof Array) ||
          Object.prototype.toString.call(spec) === "[object Array]") {
        if (callback) {
          // load multiple and join on callback
          var countdown = spec.length;
          for (var i=0;i<spec.length;++i) {(function(u){
            load(u, function (err) {
              if (err) {
                countdown = 0;
                //throw err;
                callback(err);
              } else if (--countdown === 0) {
                callback();
              }
            });
          })(spec[i]);}
        } else {
          // load multiple (blocking) -- don't use this for network resources
          for (var i=0;i<spec.length;++i) {
            load(spec[i]);
          }
        }
        return;
      } else if (typeof spec === 'string') {
        spec = {url:spec};
      }
      if (!spec.url && spec.id) {
        spec.url = spec.id + '.js';
      } else if (spec.url && !spec.id) {
        var m = /^[^\/]+\/\/[^\/]+\/(.+)$/.exec(spec.url);
        if (m) {
          spec.id = m[1];
        } else {
          spec.id = spec.url;
        }
        spec.id = spec.id.replace(/\.[^\.]+$/, '');
      } else if (!spec.url && !spec.id) {
        throw new TypeError('missing both "url" and "id"');
      }
      // normalize url
      spec.url = normalizeUrl(spec.url, window.location);
      var xhr = new XMLHttpRequest();
      var async = !!callback;
      function evalResponse() {
        try {
          eval('require.define("'+spec.id+'",'+
               ' "'+spec.url.replace(/"/g, '\\"')+'"'+
               ', function (require, module, exports) {'+xhr.responseText+'});');
        } catch (err) {
          err.message += ' in '+spec.url;
          throw err;
        }
      }
      xhr.open('GET', spec.url, async);
      if (async) {
        xhr.onreadystatechange = function (ev) {  
          if (xhr.readyState == 4) {
            if ((xhr.status < 300 && xhr.status >= 200)
              || (xhr.status === 0 && !spec.url.match(/^(?:https?|ftp):\/\//i))) {
              try {
                evalResponse();
                callback(null);
              } catch (err) {
                callback(err);
              }
            } else {
              callback(new Error('failed to load remote module with HTTP'+
                                 ' response status '+xhr.status+' '+
                                 xhr.responseText));
            }
          }
        };
      }
      xhr.send(null);
      if (!async) {
        evalResponse();
      }
    }