結果 : javascript wait until another function completes