/    Sign up×
Community /Pin to ProfileBookmark

set link as visited

i am using a link to run a javascript function doit() as follows:

<a href=”javascript:doit(‘fred’) …..> clickfred </a>

working fine except that the user sees clickfred (all names are fictional) underilined as alink, and would normally expect the style to change to the style for vlink. but it doesnt, because, i guess, no link has been visited.

< a href=” onclick= etc

is no good because it changes the main window (which is still to be open).

any bright ideas? can i use javascript to set the style of ‘clickfred’ aftre the click?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliAug 18.2003 — use the following CSS for anchor tags

A:link Unvisited hyperlink

A:visited Visited hyperlink

A:active Active hyperlink, i.e. the effect when clicking the hyperlink

A:hover When the 'mouse' move over the hyperlink

I hope this helps
Copy linkTweet thisAlerts:
@mbloxhamauthorAug 24.2003 — thanks Khalid...

I had the CSS style set ok, but it turns out - i think - to be a platform problem: the Mac, both IE in os9 and IE and Safari in os X would not change the style if i visited a site via a new window popup (window.open...)

the history is changed, but only temporarily, to show the visited page .. at least on the setup i am using now.

a colleague checked the code on windows, and it showed a visited link style just fine.


i used a workaround:

<a href=javascript:thepopup(url) onclick="this.style.color='red'">
×

Success!

Help @mbloxham spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...