code: function appendScript(str, resolver) {
          var ScriptTagName = "script";
          var script = Document.createElement(ScriptTagName);
  
          // at least one script could be found,
          // the one which wraps around asyncJS
          var scripts = Document.getElementsByTagName(ScriptTagName);
          var lastScript = scripts[scripts.length - 1];
  
          script.async = true;
          script.src = str;
  
          if (!resolver) return;
  
          // executes callback if given
          script.loadStatus = false;
  
          var resolveScript = factory(resolveScriptEvent, script, resolver);
  
          // onload for all sane browsers
          // onreadystatechange for legacy IE
          script.onload = script.onreadystatechange = script.onerror = resolveScript;
  
          // inline script tends to change nearby DOM elements
          // so we append script closer to the caller
          // this is at best a ballpark guess and
          // might not work well with some inline script
          var slot = lastScript;
  
          // in case running from Console
          // we might encounter a scriptless page
          slot = slot || document.body.firstChild;
  
          slot.parentNode.insertBefore(script, slot);
      }
docs: @private
  @name appendScript
  Append asynchronous script to DOM
  
  @param {String|Function} str
  @param {Object} resolver