I'm having a serious problem with an ajax post not sending any request intermittently.
In my script I first place a getJson request to my own server to create a database entry. This never fails:
jQuery.getJSON("/counter/placeorder", function(json) {
var txndatetime = json.txndatetime;
var hash = json.hash;
...
With some values returned via JSON from my server I then try to send an ajax post request to a foreign server.
$.ajax({ url: "https://www.someserver.com/processing",
type: "POST",
data: {
'txndatetime': txndatetime,
'hash': hash,
...
},
complete: function(xmlHttp, status) {
window.location = '/counter/exit';
}
});
But the problem lies not with the foreign server. I wrapped the ajax post in another ajax post in which I tried to send the same request to another debugging server first and sometimes there doesn't seem to be a post request at all.
If however I serialize the data and put that in my debugging post request's url, then this does get sent to my debugging server while the following post to the actual processing server does not fire. This would hint at a problem with the retrieved data from the getJSON, but the data is identical in form to the requests that do work.
The only idea I'm left with is that this might be a time out issue with the JSON. Any ideas?