Use $.post with chained callbacks instead of $.ajax