What's the best way to reload a web page using JavaScript? or How can I reload a web page with JavaSc

18 Replies, 771 Views

`location.reload()` is fine, but if you’re worried about cache, pass `true` like `location.reload(true)`. That’ll skip cache.

The `window.location.href` trick does work, but it’s kinda hacky. Not my fave.

Also, if your reload web page javascript isn’t working, maybe something’s preventing the default behavior? Try wrapping it in a `setTimeout` to see if that helps.

Messages In This Thread



Users browsing this thread: 1 Guest(s)