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

20 Replies, 871 Views

lol i feel u on the js refresh the page struggle.

`location.reload()` is usually fine, but sometimes u gotta wrap it in a function or call it after an event listener.

like:
```js
document.getElementById('myButton').addEventListener('click', () => location.reload());
```

Messages In This Thread



Users browsing this thread: 1 Guest(s)