title: Uncaught TypeError with fadeIn in jQuery 1.9
body: <p>Here is the problem, unfortunately we <a href="http://blog.jquery.com/2012/06/28/jquery-core-version-1-9-and-beyond/" rel="nofollow noreferrer">have to support IE8</a>.<br/>
  So I had to change from using the latest jQuery 2.0+ back to <a href="http://code.jquery.com/jquery-1.9.1.js" rel="nofollow noreferrer">jQuery 1.9</a>.</p>
  
  <p>Now we use a lot of jQuery to load up different sections of our dashboard, we <code>fadeOut</code> previous screens and <code>fadeIn</code> new screens. I thought I had fixed all of these problems with solutions I found <a href="https://stackoverflow.com/questions/15621878/jquery-prepend-to-crash">here(prepend html)</a> and <a href="https://stackoverflow.com/questions/15258924/line-breaks-in-jquery-ajax-html-callback-cause-errors">here(ajax HTML)</a>.</p>
  
  <p>However still having one more problem with the same error message below:</p>
  
  <p><em>Error:</em></p>
  
  <pre><code>Uncaught TypeError: Cannot set property 'cur' of undefined 
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/CBRrh.png" alt="enter image description here"></p>
  
  <p><br/>
  I've narrowed down the source to the <strong>loadResource</strong> function, which is used to switch out content.</p>
  
  <p>Basically if I comment out this line from the function below:</p>
  
  <pre><code>$content.fadeIn('fast');
  </code></pre>
  
  <p>And replace it with </p>
  
  <pre><code>$content.show();
  </code></pre>
  
  <p>The problem is solved and we no longer get that 'cur' error. <em>However we lose our fadeIn effect.</em>
  <br/><br/></p>
  
  <p>How would you approach this problem that solves the <code>Uncaught TypeError</code> in jQuery 1.9 <strong>while keeping our</strong> <code>fadeIn</code> effect on <code>$content</code>?<br/><br/></p>
  
  <pre><code>var loadResource = function(url, params, callback) {
  WHOAT.networking.getToServerWithAjax(url, params, function (response) {
          var $content = $($.parseHTML(response.trim()));
          var $container = $('#dashboard-display');
          var $content_to_hide = $container.children();
  
          $.when($content_to_hide.fadeOut('fast')).then(function () {
              $content.hide();
              $container.append($content);
  
              //$content.fadeIn('fast'); // &lt;- buggy in 1.9.1
              $content.show(); // &lt;- works, but no fadeIn
  
              $content_to_hide.remove();
  
              if(callback) {
                  callback();
              }
          });
      });
  
  // CSS updates...
  };
  </code></pre>