結果 : javascript wait for callback function to finish