tags:

views:

12

answers:

1

Can someone help me figure this out please?

I am working with an inline editor and need to alert() an error if the server returns one. I have no idea how to do this. I'm brand new to jquery so you;ll have to spell things out for me.

I'm using the editor here: http://code.google.com/p/jquery-in-place-editor

I'm using the following code example. THis works to edit but I have no alert on error.

      $("#editme1").editInPlace({
//      callback: function(unused, enteredText) { return enteredText; },
        url: 'server.php'
      });
A: 
$("#editme1").editInPlace({
    //callback: function(unused, enteredText) { return enteredText; },
    url: 'server.php',
    error: function() {alert('Server responded with error');}
  });

According to your link.

sje397
Thanks sje. Can you tell me what I need to return from my server code? false? I can't seem to trigger an error
jim
@jim: [This](http://stackoverflow.com/questions/3052715/php-how-to-return-an-http-500-code-on-any-error-no-matter-what) seems to be how it's done.
sje397
@sje, I just tried returning false but I don't get an alert.
jim