title: Error: Cannot read property 'defaultView' of undefined, using jQuery
body: <p>I have this code</p>
  
  <pre><code>$(document).ready(function (){
      var Form_addTurbo = $('form#Form_addTurbo');
      Form_addTurbo.submit(function (e){
          e.preventDefault;
          v = new Notification('Creating Turbo.', 'information', 'Working..', function(){return;});
          $.post('/api/turbos/new.php', {
              action : 'createNew'
          }, function (r){
              v.hide();
              if(r.success){
                  new Notification('Turbo Create.', 'saved', '', function(){return;});
              }else if(r.error){
  
              }else{
                  new Notification('Something went wrong.', 'error', '', function(){return;});
              }
          }, 'json');
          return false;
      });
  });
  </code></pre>
  
  <p>Which uses this api</p>
  
  <pre><code>$(document).ready(function(e) {$("body").prepend('&lt;ul id="notifications"&gt;&lt;/ul&gt;');});
  
  /**
   * Global notification system
   *
   * @param  String      Message to be displayed
   * @param  String      Type of notification
   *
   * @author    Bram Jetten
   * @version    28-03-2011
   */
  Notification.fn = Notification.prototype;
  
  function Notification(value, type, tag, onclickfunc) {
    this.log(value, type);
    this.element = $('&lt;li&gt;&lt;span class="image '+ type +'"&gt;&lt;/span&gt;' + value + '&lt;/li&gt;');
    if(typeof tag !== "undefined" &amp;&amp; tag !== '') {
      $(this.element).append('&lt;span class="tag"&gt;' + tag + '&lt;/span&gt;');
    }
    if(typeof onclickfunc == 'function'){
        this.element.click(onclickfunc);
    }
    $("#notifications").append(this.element);
    this.show();
  }
  
  /**
   * Show notification
   */
  Notification.fn.show = function() {
    $(this.element).slideDown(200);
    $(this.element).click(this.hide);
  }
  
  /**
   * Hide notification
   */
  Notification.fn.hide = function() {  
    $(this).animate({opacity: .01}, 200, function() {
      $(this).slideUp(200, function() {
        $(this).remove();
      });
    });
  }
  
  /**
   * Log notification
   * 
   * @param  String      Message to be logged
   * @param  String      Type of notification
   */
  Notification.fn.log = function(value, type) {
    switch(type) {
      case "information":
        console.info("*** " + value + " ***");
        break;
      case "success":
        console.log(value);
        break;
      case "warning":
        console.warn(value);
        break;
      case "error":
        console.error(value);
        break;
      case "saved":
        console.log(value);
        break;
      default:
        console.log(value);
        break;
    }
  }
  </code></pre>
  
  <p>So what happens is that I try close the notification using the hide function that I believe it gives but I get this error.</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'defaultView' of undefined</p>
  </blockquote>
  
  <p>I believe it doesn't know what "this" is but how would I be able to get this to work.</p>