Difference between [removed].assign() and [removed].replace()

前端 未结 4 752
既然无缘
既然无缘 2020-11-28 03:56

What is the difference between window.location.assign() and window.location.replace(), when both redirect to a new page?

4条回答
  •  一整个雨季
    2020-11-28 04:28

    The difference is how history is handled. "Replace" won't give you history, "assign" will.

提交回复
热议问题