I am making a Nodejs application and I am using jQuery to send ajax request to server side.
Weirdly, the browser will send ajax request for multiple times.
Is this because of no response being returned from server side?
$.ajax({
type: "POST",
url: "/triggerBatchJobs",
data: JSON.stringify(buildInfo),
contentType: 'application/json'
}).done(function(msg){
console.log(msg);
});
I post ajax request by this code snippet, I monitor the network tab in chrome dev tools and found the request stays in pending since there is no response returned from server side.
Will the browser try to send and get response again for these pending request?
BTW, I use socket.io in this application. Is this problem due to socket.io?
script.
var socket = io();
socket.on('complete',function(msg){
alert('Complete');
})
in node.js
io.sockets.emit('complete');