Why won't window.location.href be intercepted?

What"s the difference between

and a direct request request

Mar.10,2021

you mean enter url in the address bar to edit the a tag?

The biggest difference of

is that window.location.href allows you to directly control the jump of the user's page in the code.
for example, if you add an item to your shopping cart on Taobao, but you don't log in, js will use window.location.href to jump you to the login page. If you pop up box sorry, you are not logged in, please click this url to jump to the login page, or enter https://login.taobao.com/memb. in the address bar, this user experience is not good.

Menu