結果 : javascript wait for another function to finish