I am trying out “CSS Sprites” (using one file to reperesent a page’s button graphics in various states) and I made a page that has a different image for link, hover, and visited.
When I click the link I can no longer see what the unvisited link looks like.
Is there a code way to tell a browser to “forget what links have been clicked on on this page”?
Preferably I’d like a html way, but failing that - javascript, asp, or php.
I doubt if there’s any way to actually delete history entries in any cross-browser way. You could probably do it with a nonportable script in your browser of choice, though I don’t know how.
An easier way might be to tell your server to add a random query string (or the date and time, or whatever) to the links you’re interested in, so that every time you reload the page you get a URL you haven’t seen before. That is, rather than <a href=“link.html”>…</a> you have <a href=“link.html?20100214123456”>…</a>.
Thanks. That worked. (I happen to have a copy of visual studio on the computer I’m using and that has a cursor editor)
And thanks for answering about the forgetting visited links question.
Why would you have a different sprite state for a visited link if you don’t want users to see the “visited” version of the link? If you have some conditional that determines whether or not the user should see the visited, you could just use two seperate classnames or ids, such as
I didn’t not want the users to see visited links. I wanted them to be able to reset the page. It was simply a demonstration of the sprite technique. A user could see link image. They could hover over it to see the hover image. They could click it to see the visited image. And finally they could reset the page to go back to being able to see the link image.
Not sure if you’ve solved your problem yet, but I should say (since I forgot to mention it above) that you can do the same link-decoration technique I mentioned earlier using JavaScript, entirely on the client side. This is probably a nicer method if you want users to be able to do it (reduces server load by not requiring refreshes).
Don’t know the answer to the question but if it is just for demonstration purposes could you use javascript or PHP to generate a random URL string each time the page is loaded so that there’s always an unvisited link on the page?