Chris,

Why don't you return the formatted column when it is posted.  Then you
could do something like this:

$(document).ready(function() {
  $('#myForm').ajaxForm(function(data) {
       $('#thankyou').show('slow');
       $('newcomment').hide();
       $('#comments h1').after(data);
  });
});

Mike

On 7/13/07, Chris <[EMAIL PROTECTED]> wrote:

Hello everyone,
I'm a bit of a noob to this whole AJAX thing so you'll have to forgive
me.  I've setup a blog, using jQuery the comments are added to mysql
using this form plugin (http://www.malsup.com/jquery/form/#getting-
started).  Posting the comments work great, I was even able to add in
a confirmation saying "Thank you for posting".  My dilemma is showing
the new comment on the page without refreshing.  Here is the page to
test it: (http://www.iphoneappr.com/index.php?post=48).  I was
thinking I could do a  $.get to an external php page that queries
mysql with the most current post and put it in a specific div on the
page.
Here is the function for the form.

    <script type="text/javascript">
        // wait for the DOM to be loaded
        $(document).ready(function() {
            // bind 'myForm' and provide a simple callback function
                        $('#myForm').ajaxForm(function() {
                                $('#thankyou').show('slow');
                                $('#newcomment').hide('fast');

            });
        });

    </script>

Thank you for any help!  This is driving me nuts!!!!!


Reply via email to