jQuery.fn - Why isn't this working?
<p>What is the problem here? (Besides having redundant code). <code>$.getJSON</code> works as expected. However <code>$.postJSON</code> isn't working. I can inspect <code>$.fn</code> via firebug and sure enough postJSON is listed. However if I try to call it, I get a no function defined error. </p>

<pre><code>jQuery.fn.getJSON = function(path, opts){
  this.extend(opts, {
    url: path,
    dataType: 'json',
    type: 'GET'
  });

  var invalid = opts.error;
  opts.error = function(xhr, status){
    var data = $.httpData(xhr, 'json');
    if (invalid) 
      invalid(data);
  }

  this.ajax(opts);
};

jQuery.fn.postJSON = function(path, data, opts) {
  this.extend(opts, {
    url: path,
    data: data,
    dataType: 'json',
    type: 'POST'
  });

  var invalid = opts.error;
  opts.error = function(xhr, status){
    var data = $.httpData(xhr, 'json');
    if (invalid) 
      invalid(data);
  }

  this.ajax(opts);
};
</code></pre>
