結果 : javascript wait for ajax function to finish