What's the best way to use JS to refresh the page? or How can I force a page refresh with JS?

20 Replies, 862 Views

"What's the easiest way to js refresh the page?"

hey guys, quick question—what’s the simplest way to js refresh the page?

i’ve tried `location.reload()` but sometimes it doesn’t work like i expect.

also, is there a diff between `location.reload()` and `window.location.href = window.location.href`?

or maybe there’s a better trick?

pls help a noob out lol

---

*or*

"Why isn’t my js refresh the page code working?"

ugh, my js refresh the page script just won’t fire.

using `location.reload(true)` but nada.

am i missing something? cache issue maybe?

also, does it matter if it’s in a function or just loose in the script?

thx in advance!

---

*or*

"js refresh the page—best method?"

need to js refresh the page after a form submit.

should i use `location.reload()`, meta tags, or something else?

kinda want it to feel smooth, not a hard reload.

any tips?

cheers!

Messages In This Thread
What's the best way to use JS to refresh the page? or How can I force a page refresh with JS? - by - 27-09-2024, 11:06 PM



Users browsing this thread: 1 Guest(s)