HighDots Forums  

how to determine if a link has been visited

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss how to determine if a link has been visited in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Eric
 
Posts: n/a

Default how to determine if a link has been visited - 01-22-2006 , 05:31 PM






If i reference a link in java script, is there a way to test if its been
visited or not? I need to highlight the link in code but once the highlight
is moved off the link i want to restore its proper color based on if its
been visited or not.
Thanks
Eric


Reply With Quote
  #2  
Old   
Kimmo Laine
 
Posts: n/a

Default Re: how to determine if a link has been visited - 01-23-2006 , 02:06 AM






"Eric" <nospam (AT) email (DOT) com> wrote

Quote:
If i reference a link in java script, is there a way to test if its been
visited or not? I need to highlight the link in code but once the
highlight
is moved off the link i want to restore its proper color based on if its
been visited or not.
Thanks
Eric

highlight the link by setting a classname to it, and use css to set the
color for that particular class. Once highlighting is not required any
longer, remove the classname. The link will then adopt it's original state.

I made a little example where I have a button that higlights a link with
color and backgroundcolor when clicked, and then removes the higlight when
clicked again. And sure enough, before visiting the link, when the highlight
was removed the link color changed back to the blue it was, but when I
visited the link and went back, did the higlight again, this time the link
changed back to purple which means a visited link. Tested on IE and Firefox.

Heres my example page:
http://www.outolempi.net/hilite.html


--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
spam (AT) outolempi (DOT) net | Gedoon-S @ IRCnet | rot13(xvzzb (AT) bhgbyrzcv (DOT) arg)




Reply With Quote
  #3  
Old   
Eric
 
Posts: n/a

Default Re: how to determine if a link has been visited - 01-25-2006 , 12:36 AM



Kimmo Laine wrote:

Quote:
"Eric" <nospam (AT) email (DOT) com> wrote in message
news:l8ednWcwnqFViEneRVn-pw (AT) comcast (DOT) com...
If i reference a link in java script, is there a way to test if its been
visited or not? I need to highlight the link in code but once the
highlight
is moved off the link i want to restore its proper color based on if its
been visited or not.
Thanks
Eric


highlight the link by setting a classname to it, and use css to set the
color for that particular class. Once highlighting is not required any
longer, remove the classname. The link will then adopt it's original
state.

I made a little example where I have a button that higlights a link with
color and backgroundcolor when clicked, and then removes the higlight when
clicked again. And sure enough, before visiting the link, when the
highlight was removed the link color changed back to the blue it was, but
when I visited the link and went back, did the higlight again, this time
the link changed back to purple which means a visited link. Tested on IE
and Firefox.

Heres my example page:
http://www.outolempi.net/hilite.html


Thanks, I'll try out that method and see if it works
Eric



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.