I have a jquery $.post function lik so:
$.post(\'/test\',json_data, function(data) { result=data });
this fun
Check for validity inside the callback
$.post('/test',json_data, function(data) { var result=data; if(result === true) { // do some ok processing... } else { // do not ok processing... } });