Jquery help adding an ajax call
<p>Please have a look at these two pieces of code. I am using jquery edit in place. This is the code that it uses and works.</p>

<pre><code> $("#name").editInPlace({
   url: 'test.php',
   error: function() {
     alert('error');
   }
  });
</code></pre>

<p>What I want to do is replace the alert with a div that will echo the error message instead. This next piece of code is one that I am using in a totally separate of the site. I'd like to use that same functionality in the code above if possible. Can someone please tell me if this is possible and how to do it?</p>

<pre><code>$.ajax({
  type: "POST",
  url: "post.php",
  dataType: 'json',
  success: function(data){
    var div = $('&lt;div&gt;').attr('id', 'message').html(data.message);
    if(data.success == 0) {
      $(div).addClass('ajax-error');
    } else {
      $(div).addClass('ajax-success');
    }
  }
});
</code></pre>
