Home > Net >  How to make an Anchor Tag link erase past visited page?
How to make an Anchor Tag link erase past visited page?

Time:12-10

I have a anchor tag. For the first time(color deep blue link) when I click it, it redirects me to my dynamic graph which forms a curve, you can see the curve being rendered.

But when for the second time when I click the anchor tag(pale pink color), it redirects me to the same dynamic graph but the graph is already loaded/rendered, you don't see the curve being rendered.

Can I solve this problem, as I always want the link and graph react as if its always rendered for the first time

How to solve this by either using JavaScript or PHP. Thanks in advance.

Image showing link has already been visited

CodePudding user response:

  1. If you have issue with just colour of the link then you can change the colour in css

a:visited{
    color: ' #00008B'
    }

  1. For re-rendering the links on map . Try clearing cache because browsers stores cache of the all websites that you have visited. This answer talks about how programmatically empty browser cache.

CodePudding user response:

You could trick the browser by changing the URL everytime by adding a random parameter. You may name it totally different if you like.

printf('<a href="graph.php?rand=%s">Visit my graph</a>', microtime(true));

So the URL looks like different on every call and won't get the cache hit, because it is not the same.

<a href="graph.php?rand=1670596569.4425">Visit my graph</a>
<a href="graph.php?rand=1670596599.099">Visit my graph</a>
  • Related