title: how to change the arguments when extending a jQuery function
body: <p>When I modify the arguments of <code>html()</code> I get an error that I can't figure out.</p>
  
  <p>In this example I'm just <code>stringifying</code> and then <code>parsing</code>, and it causes the same error:</p>
  
  <pre><code>(function($) {
      var oldhtml = $.fn.html;
      $.fn.html = function() {
          var args = JSON.stringify(arguments);
          // do some stuff with args
          args = JSON.parse(args);
          var ret = oldhtml.apply(this, args);
          return ret;
      };
  })(jQuery);
  </code></pre>
  
  <p>Getting this error:</p>
  
  <blockquote>
    <p>jquery-ui.min.js:5 Uncaught TypeError: e(...).addClass(...).html(...).appendTo is not a function</p>
  </blockquote>