結果 : javascript wait for other function to finish