I have a problem where sometimes the data payload in the AJAX code below is not sent to the server.
$.ajax({
type: "POST",
url: loans_url,
data: {'loan[sample_id]':sample_id},
beforeSend: function() { sample.remove(); },
success: function(data) { $('#basket table tr:last').after(data); },
error: function() { $('#results').prepend("Apologetic error message..."); }
});
"Good" post sends data that looks like this: loan[sample_id]: 1234. A "bad" message hits the correct URL, but does not send any data.
I cannot reproduce this in development, but it happens about once a day in production. In Firebug, I tried to sabotage the markup on the page from which sample_id was obtained, but it just caused a submission loan[sample_id]: undefined, which is not the problem I am facing.
Is there any way to transfer payload data at all? Can you suggest how I can debug this further? (All this with jQuery 1.3.2.)