javascript - Difference between window.location.href=window.location.href and window.location.reload() -


what difference between javascript's

window.location.href = window.location.href 

and

window.location.reload() 

functions?

if remember correctly, window.location.reload() reloads current page post data, while window.location.href=window.location.href not include post data.

as noted @w3max in comments below, window.location.href=window.location.href not reload page if there's anchor (#) in url - must use window.location.reload() in case.

also, noted @mic below, window.location.reload() takes additional argument skipcache using window.location.reload(true) browser skip cache , reload page server. window.location.reload(false) opposite, , load page cache if possible.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -