Search code examples
jquerycssajaxjquery-mobilebrowser-history

AJAX Links Not Detected By A:Visited


I'm noticing that a:visited styles don't work on links that are requested via JavaScript. On a standard user click though, the exact same link registers as visited, both immediately and on subsequent refreshes. I'm not sure if this is unique to jQuery Mobile (where I first encountered it) or whether it's a browser limitation that I didn't know about?


Solution

  • You probably need to change the location.hash if you want it to work with history and visited links styling.

    Keep in mind that the visited links styling works somewhat inconsistently between browser after the visited links based browsing history privacy vulnerability was made popular by Did You Watch Porn website.