How to refresh the page?

Asked

Viewed 9,264 times

-2

I needed when the person clicked on a button on the previous page to move to the next page and refresh it. How do I do this?

I need this refresh because otherwise I’ll have to do a "gambiarra" to run a shopping cart on the button I’m using a window.location.

  • 1

    From window.location.href = "destination";, and on the destination page of a window.location.Reload();

  • If it moves from one page to the other the page is no longer reloaded? So why do you need to reload it again? And even if it makes sense somehow, it seems to me that the solution is, in fact, to use the window.location, then recommend [Edit] the question and add your code.

  • It works perfectly the shopping cart, but a crude reason if the person passes to the other page he loads often with the correct information, but in certain cases does not even load the data. I’ve searched all the code and the only solution found is to refresh the page

  • @Rickpariz it will not give Reload all the time that load the page?

  • 1

    So you put the code in the question so we can try to understand the real problem. Keep updating the page until displaying.

  • @Felipemichaeldafonseca Vai

  • It’s that instead of going to the other page and taking the values of the DIVS it just doesn’t take the values of that page, ie it takes no value, given as null. So if I give him an F5, he’ll get it 'cause he uploaded the page.

  • 2

    Please put the code in the question. In the meantime I will vote to close the question, as nothing you are saying is making sense.

Show 3 more comments

1 answer

2

Use onClick with window.location.reload():

 <input type="button" value="Refresh Page" onClick="window.location.reload()">
  • I’m going to give one up, because the window.location.reaload() served me. rs

Browser other questions tagged

You are not signed in. Login or sign up in order to post.