View Full Version : 'visited' links not working for popups in Netscape
bryndyment
04-27-2003, 06:24 PM
Hi,
Please visit http://www.hoologic.com/mason/link.htm in both IE and Netscape. In IE, when you click on any of those links (and close the popup), the link will correctly turn to the 'visited' color. Not so in Netscape.
Any ideas on how to make Netscape happy?
Fix the code, as shown by this [link (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.hoologic.com%2Fmason%2Flink.htm&charset=iso-8859-1+%28Western+Europe%29&doctype=HTML+4.01+Transitional&ss=1&outline=1&sp=1&verbose=1)]?
The page doesn't have a valid structure. add <html> <head> and <body> tags then try again. Also is that %20 causing a problem?
The more I look, the more syntax errors I see. Any one of those might cause the browser to choke on it.
Write it into a page of valid code, then lets try again.
bryndyment
04-27-2003, 09:57 PM
I've updated the code to include the boilerplate HTML (it wasn't there because I extracted the problem code from my page, into that test page).
The %20 is a space, because I read that some browsers don't handle "visited" properly if there are spaces in the pragma.
Anyhew, all those links are just variants of each other... just trying to find one that Netscape recognizes in terms of the "visited" property.
liorean
04-27-2003, 10:18 PM
The browser doesn't know that the link is visited because the html and scripting engines are separated. No javascript link is equal to any other because the html engine doesn't know what it evaluates to.
bryndyment
04-27-2003, 10:34 PM
Thanks for the info.
Seems kind of strange, though. A static URL can be just as "dynamic" as a JavaScript link, right? Seems strange that the browser avoids labeling a JavaScript link as "visited" because of its dyamic nature, when the same can be said for any supposedly "static" link (the only difference being that the logic is on the server-side, rather than client-side via JavaScript).
I think I prefer IE's approach here. No browser can never "really" know whether a page has been truly visited before, but, at least with IE, the developer can make the call, and have both "static" and JavaScript links get marked as "visited".
Anyway, I shouldn't be using pop-ups anyway!
liorean
04-27-2003, 10:46 PM
Well, the thing here is, a url point to a resource. The resource may change, but it's the same resource nonetheless. A javascript: link on the other hand doesn't point to to a resource, it points to something that evaluates to a resource. The resource may change, and therefore you can't say even javascript:void(0); is equal to javascript:void(0); even though you know both will evaluate to undefined.
bryndyment
04-27-2003, 11:01 PM
I agree with your comments.
Although, I think the user experience suffers. If the developer knows that it's effectively a static "thingie" that's being activated on click, then he should be able to communicate that to the user. (Just minor grumbling on my part...)
One way to "trick" NS, though, which I just found out on another forum:
<a href="static.htm" onclick="open( 'static.htm', ... ); return false">link</a>
Isn't quite perfect, though, as the link only shows as "visited" after a page refresh. Still, close enough. Although you might cringe at this "solution"?
liorean
04-27-2003, 11:26 PM
I've got a very strong opinion about what a link is and what a javascript: href is:
A link is a reference to a resource.
A javascript: href is only a link if it can be considered a reference to a resource . This means it must give the same either data or type of data no matter from where it's called. If you cannot bookmark it and use it on any other page to get the same results when it comes to either data or type of data, it's not to be considered a link but a functionality.
If you have a javascript: href that qualifies as a resource, it can be used in a link. If there is a standard url that provides the same resource, that should be in the href and the javascript should be moved to the onclick event handler, overriding the normal href, or not be used at all. If it's a functionality that only is relevant on the current page or site, it shouldn't be in a link at all, but as an event handler on the proper element for that type of functionality. If no such element exists, link is still not the right place to have it.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.