title: Jquery $(document).prepend: "TypeError: e is null" inside delegated event handler?
body: <p>This simple line:</p>
  
  <pre><code>$(document).prepend('&lt;div&gt;some text&lt;/div&gt;');
  </code></pre>
  
  <p>Produces an error from the Jquery library:</p>
  
  <pre><code>TypeError: e is null
  </code></pre>
  
  <p>The error is coming from the Jquery file, not my code. My function does not use any variable "e". The Jquery version is 1.9.1. I didn't find any known issues that produce this error, but the line above is the one causing it, since the error does not occur when the line is commented out. I can append elements in other places just fine. The function where the problem line occurs is called from a MouseEnter event handler, if that makes a difference.</p>
  
  <p>Any idea what could be causing this?</p>
  
  <p>If you want more code (irrelevant lines omitted for clarity and brevity):</p>
  
  <pre><code>// Create a delegate event handler:
  this.protected.$element.on('mouseenter','.'+this.protected.Prefrences.TriggerClass,function(e){base.eMouseEnter(e,this)});
  
  
  // Called when the user hovers over the tooltip
  ATK.ToolTip.prototype.eMouseEnter = function(e, eventThis){
     this.ShowToolTip($(eventThis));   
  }
  
  
  ATK.ToolTip.prototype.ShowToolTip = function($TipElement){
     $(document).prepend('&lt;div&gt;sometext&lt;/div&gt;'); // Triggers "TypeError: e is null" ?!
  }
  </code></pre>