結果 : javascript wait for callback to finish