Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

CarlEOgden's avatar

location.reload(true) isn't reloading properly

Hi

I have a js routine in my Laravel app that saves some data to the database using an axios call that is working, however, i need to force a page reload so the data shows in a table. when I call

location.reload(true)

The data doesn't show but if i do a manual reload of the page by clicking it, the data appears in the table.

Any ideas of how to fix this?

Cheers Carl.

0 likes
7 replies
Sinnbeck's avatar

Does the page actually reload?

Does it work if you try running it in the console ? Press f12 and select Console. Type location.reload() and press enter

CarlEOgden's avatar

@sinnbeck

Thanks for your reply, I can only answer yes and no! Yes, the form disappears and re-draws (giving the impression of a reload) but No, the new line of data does not appear.

I will comment out the reload, and try your suggestion of doing a console reload after i press the save button!

Regards Carl.

Sinnbeck's avatar

If it works, can you show the vue code? :)

davidifranco's avatar

Try this.

window.location.href=window.location.href

This should give you a full reload.

Sinnbeck's avatar

You shouldnt need both :) Both reloads the page (meaning the second wont be triggered)

teresarivers's avatar

Hi Laracast Community!

It sounds like the issue might be due to the browser caching the page or the data table not being re-rendered properly after location.reload(true). While location.reload(true) is intended to force a reload from the server, most modern browsers ignore the true parameter due to deprecation. Instead, you could try using window.location.href = window.location.href to ensure a full reload, or better yet, update the table dynamically after your Axios call succeeds, rather than reloading the entire page—this would offer a smoother UX and avoid reload quirks... Try out this App: www.movieboxhd.app

Please or to participate in this conversation.