Hey,

don't use document.write() or alert() to debug - either use console.log() or have a div in the document which can display debugging information and append any data to it.

$('#testform').live('submit',function(){
   var formData = $(this).serialize();
   console.log(formData);
   $.post('ajax/setvalue.php', formData, function(data){ console.log(data) });
});

Firebug should log the POST as well as any response from it as well.

HTH

on 25/11/2009 21:10 Rockinelle said::
Any new eyes out there? Not sure why this got changed to accessibility
discussion.

On Nov 24, 4:46 pm, Rockinelle <ericbles...@gmail.com> wrote:
Hey everyone,

I've been trying to make a .post work for me and I'm using firebug to
attempt to debug my problems. I am trying to use ajax to process a
form and from what I can tell in Firebug, I am not getting a response.
Now I have removed the action in the form itself so it's just reloads
the page after the .post fails.

$('#testform').live('submit',function(){
    var formData = $(this).serialize();
    alert(formData); //to verify the data is formatted properly and it
is.
    $.post('ajax/setvalue.php', formData, function(data)
{ document.write(data) });

});

The path to the remote script is correct. formData is formatted
properly. The php doc only echo the string 'pass' to let me know it
got the request. I'm using .live rather than .submit because the form
is loaded via an ajax call so it waits for the form to load before it
binds this ajax request to the form.

So if you have some tips on my code great, but I'd really like a good
tool to debug this myself. Maybe there is something in firebug I'm
missing.

Reply via email to