You need an href that matches the XHR URL. You don't have to follow
the href (preventing default), but CSS needs it to match to the
browser history.
Either that, or you can add a CSS class like 'fakevisited' onRequest
and also record all this info in your db so you can render in the
markup afterward. But for accessibility purposes, it's best to have
the href in there anyway, and much more manageable. I don't like to
fake visited but really use the browser to the fullest (also allowing
people to clear their history, use InPrivate sessions, etc. as
expected).
-- S.
> http://jsfiddle.net/NF2jz/2468/
There was some misinfo in my first post: I realize I wasn't actually
describing my methods accurately (as I see now looking at one of my
sites). I'll touch up your Fiddle by tomorrow so you can see.
-- S.
-- S.
"Open in new window" = using browser-native methods to execute the
default action.
There's nothing about the current Fiddle that won't work with the
default action -- if your back-end understands it.
> I tried to modify your example to take the real url with hash but that
> didn't work.
If you do this with a hash-style navigation, your back end needs to be
changed to manage state with hashes, i.e. if a request comes in for
#state, the back-end page needs to inspect 'state'. It's perfectly
doable, but you'll never do it with client-only modifications.
> I wonder if this could be done with a html5 solution.
Yes, but it will never be backward-compatible.
-- S.