window.location.assign(url)和window.open(url,’_ self’)之间有什么区别?
相关问题:
> Difference between window.location.assign() and window.location.replace()
> What’s the difference between window.open(url) and window.location.href = url on Firefox?
解决方法
window.location.assign将为当前窗口分配一个新的URL值. window.open将打开一个新窗口(可能在新选项卡中,或不在,取决于)传递的url的值.
这是创建新窗口和编辑现有窗口之间的区别.