I have the following code:
$(\"#submit_financials\").live(\'click\', function(event){
event.preventDefault();
// using serialize here to pass the POST v
You can try using deferred objects If you want to generate graph before alert but want both calls to be completed.
$.when (
$.post("/ajax/custom_filter/", serialized_data),
$.post("/ajax/force_download/", serialized_data)
).done(function(a1, a2){
/* a1 and a2 are arguments resolved for the
custom_filter and force_download post requests */
var customFilterResponse = a1[2];
/* arguments are [ "success", statusText, jqXHR ] */
//generate graph.
alert('hello');
});