Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to refresh page with a href in Firefox

I am using the following code to refresh my page using a link:

<a href="javascript:history.go(0)">

This works in Safari (i.e. the page is refreshed to the new content). In Firefox however I am getting the cached page. Is there a way of adapting this to work in all browsers, or do I need a different method?

Thanks,

Nick

like image 616
Nick Avatar asked Jun 09 '12 12:06

Nick


2 Answers

You can use:

<a href='#' onclick='location.reload(true); return false;'>click me</a>
like image 148
Pointy Avatar answered Sep 18 '22 23:09

Pointy


You can just leave the href as empty and it will reload the current page.

<a href=''>Reload</a>

No need for onclick event or #.

like image 44
Nicholas Porter Avatar answered Sep 17 '22 23:09

Nicholas Porter