Thanks for the quick reply! What would the format of the html be? Like this? 1<div>returnstuff</div>
On Jun 3, 11:36 pm, Gustavo Salomé <gustavon...@gmail.com> wrote: > 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