IE7 - visited links revert to unvisted after page refresh

Posted by Gerald on Stack Overflow See other posts from Stack Overflow or by Gerald
Published on 2010-03-29T21:04:18Z Indexed on 2010/03/29 21:13 UTC
Read the original article Hit count: 472

Filed under:
|
|
|
|

Hello,

A number of our users have just upgraded from IE6 to IE7. the upgreaded users are reporting an issue with visited links reverting to their unvisited color after a page refresh. This only happens to links that are using javascript instead of a hard coded URL:

<script lang="JavaScript">
<!--
 function LoadGoogle()
 {
  var LoadGoogle = window.open('http://www.google.com');
 }
-->
</script>

<a href="javascript:LoadGoogle()">Google using javascript</a>
<a href="#" OnClick="javascript:LoadGoogle()">Google using javascript OnClick</a>

The above links will revert back to the unvisited color whenever the page is refreshed. It doesn't matter if the page is refreshed because of a post back, manually hitting the refresh or f5 button, or from an auto-refresh function. Please note, the above code is an over simplification of what is actually happening, but I believe it illustrates the issue well enough.

This is causing a problem for our users because we are providing them with a list of items that are all opened into new windows via javascript when they are clicked; and refresh the parent page when the users are finished with them. Each time the parent page is refreshed all of these links revert back to their unvisited color, so our users are losing track of which items they've worked on.

I've been digging around and it looks like this is intended behavior. IE7 doesn't register these links with the browsers history. Does anyone know a work around that will allow us to keep these javascript links in the visited state without having to do a major overhaul of the apps code?

Thank you.

© Stack Overflow or respective owner

Related posts about ie7

Related posts about JavaScript