Ok. Thats is my code:
  /************************
READ
/************************/


 $(document).ready(function(){
var $send    = $("#send");
var $loading = $("#loading");
var $content = $("#content");
 function readRecords(){
$content.hide();
$loading.fadeIn("slow");
$.ajax({
type: "POST", url: "action.php", data: "action=read",
complete: function(data){
$loading.fadeOut("slow");
$content.html(data.responseText);
$content.fadeIn("slow");
delete_field();
}
});
}

readRecords();
  /************************
CREATE
/************************/

$('#send').bind('click', function(){
var params = $("#form").serialize();
$.ajax({
type: "POST",
url: "action.php",
data: "action=insert&" + params,
 beforeSend: function(){
$loading.show();
$send.attr({ disabled:true, value:"Inserting..." });
$send.blur();
 },
 success: function(txt){
$('#message').html(txt)
$loading.hide();
document.getElementById('form').reset();
$send.attr({ disabled:false, value:"Insert" });
readRecords();
 }
 });
});


});




Look, after inset in database I call again the function readRecords, and
reload all data.
But a want reload only affected data.

Thanks for your help.



On Tue, Mar 17, 2009 at 7:52 PM, James <james.gp....@gmail.com> wrote:

>
> We can help, but without showing us any code it's difficult to do so.
>
> On Mar 17, 9:29 am, Thiago <tvia...@gmail.com> wrote:
> > I add, edit, read and delete records via ajax.
> > Is working correctly.
> > Only it is not optimized, every time I do some action script reads all
> > my records again.
> > I wish only the record that action has to be recharged.
> >
> > Can you help?
>

Reply via email to