Let's suppose that I have a container <div id="container"></div>
, that I'd like to fill with dynamically generated elements from a $.post
response.. Than suddenly, for some reason, I'd like to terminate the processing of that response and have another $.post
call, and I only want to process the results of the later call.
As of now, without any termination of the previous call, the processing of the second call would only begin once the previous ended..
So.. the container I'd like to fill:
<div id="container"></container>
My jQuery in a really basic way:
$(function() {
$.post( "some.php", { val1:val1, val2:val2, .. }, function(response){
// processing of the response: append pre formatted elements to the container
});
});
And the above function is the one, that I'd like to call again with the termination of the result-processing of ANY previous calls.
I hope that at least this make any sense and if so, please help me! :) Thanks!