tags:

views:

31

answers:

2

The problem is that data is successfully transfered to the server, but the callback function is never executed in both versions:

$.post(action, formData, function (data) { alert('121'); });

or

  $.ajax({
           type: "POST",
           url: action,
           data: formData,
           dataType: "html",
           success: function(msg){
            alert('23');
           }
         });

JQuery 1.4.1

Thank you!

+2  A: 

Perhaps you are generating an error? You could try switching it to a .ajax() call and hook into the error handlers to see if this is occurring.

Raul Agrait
see and here I believed the **successfully** canard :-)
Pointy
+1  A: 

take

  $.ajax({
       type: "POST",
       url: action,
       data: formData,
       dataType: "html",
       success: function(msg){
        alert('23');
       }
     });

and add

error: function(error) {
 console.log("an error", error);
}

using firebug.

it may submit correctly but not receive a valid response.

Using firebug you can watch the requests going to and coming back from the server to make sure your getting what you expect and that the status code is a 200 in the Net tab. Console.log will also output the response from the error in the console view.

Chris