Reload de Página Web

Asked

Viewed 1,181 times

1

I intend to click on a button to make me Reload page.

Notice that the <a> in a file of navbar is external to the original file. I call navbar through the php and that button is on navbar.

Below is the code I tried to implement this:

function Refresh(){
  window.location.reload();
}
<html>
<body>
  <a onclick="Refresh"><i class="fa fa-fw fa-refresh"></i> <p>refresh</p></a>
</body>
</html>

  • This method works in any browser, Javascript enabled or not, Anyway, 100% guaranteed. <a href='URL_da_Propria_Pagina'><i class="fa fa-fw fa-refresh"></i> <p>refresh</p></a>

  • I know I did, but what I wanted was a function to have in the navigation bar so that of Reload on any page since my navigation bar is the same for all pages.

1 answer

3


You forgot to call the function Refresh():

<a onclick="Refresh()"><i class="fa fa-fw fa-refresh"></i> <p>refresh</p></a>
  • Is what gives many hours front of a computer in java is the ";" in javascript is the "()"

  • Thanks for the reply and sorry for the time!!

  • Yes I’m just waiting for the 5min

Browser other questions tagged

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