tags:

views:

792

answers:

2

What is the difference between window.location.href=window.location.href and window.location.reload() in JavaScript?

+3  A: 

If you say window.location.reload(true) the browser will skip the cache and reload the page from the server. window.location.reload(false) will do the opposite.

Mic
What is default?
Ismail
+5  A: 

If I remember correctly, window.location.reload() reloads the current page with POST data, while window.location.href=window.location.href does not include the POST data.

David Johnstone
note that when you use window.location.reload() on a POST the browser will ask you if you want resend the data to reload the page
Wimmel
@Wimmel, is there a way to disable this message ?
Kris-I
@Kris-I execute a new POST in javascript...
Wimmel