Why doesn't post return data?
- $('#dataForm').submit(function() {
- var formData = $(this).serialize();
- $.post('inc/insert.php', formData, function(data) {
- if(data == 1){
- alert(data);
- }
- }, 'html');
- });
I think I have gone off my rocker this morning. I am coding a simple form post and the post works fine. The PHP echoes a 1 on success. I am doing (a post) this in another form (using blur instead of submit) and it works flawlessly.
In Firebug there are no response headers or response even though I can confirm that the PHP is returning the 1. The data is being inserted into the database, all seems to work as expected excepted for returning a response.
Maybe I should have chosen not to work this weekend.
Can anyone tell me the error that I am committing? I apparently cannot see the forest for the trees.