inVINCable schrieb:
Hey everyone, I am using the form plugin (great btw) and the .load
function (I need to because i am using cakephp) I was wondering, what
is the best way to go about updating the comments? So far I have just
been updating the whole <div> that contains all of the comments. I
feel I may be putting too much strain on my server when I do this.
Does anyone have any comments on the best way to do this.

Any advice is GREATLY appreciated.


Hi,

you might add server side logic to simply return the HTML for the new comment and -- using append -- add it to an appropriate place. this could look like this:

$('#commentaryform').bind('submit', function() {
$.post( 'serversidelogic.php', theSerializedDataFromTheForm, function( returnedFragmentHTML ) {
   $('div#comments').append( returnedFragmentHTML );
 });
});

untested

Reply via email to