結果 : javascript wait for method to finish