try this:
$.ajax({
url:'mypage.php',
data:'item1=1&item2=2',
success:function(html){
  if(html.substr(0,1)==1){
    $('#divToUpdate').html(html.substr(1));
  }
 else{
  alert('error page');
  }
}
});

2009/6/4 Dave Roberts <dave.a.robe...@gmail.com>

>
> Hello,
> I have a page which shows items in a list.  I want to call jQuery.ajax
> and in the return have either:
> A fail response with a failure string
> or
> A success response, a success string, and a bit of HTML to replace the
> old item on my page.
>
> What's the best way to send both a response string and a bit of page
> update HTML?
>



-- 
Gustavo Salome Silva

Reply via email to