Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use jQuery to Select Visited Links

Tags:

jquery

I'm trying to select all visited links via jQuery. Here is the HTML

<div class="question-summary">
    <a class="question-hyperlink">Stuff</a>
</div>

If question-hyperlink has been visited, I was to select question-summary. Any ideas?

like image 766
Tyler Carter Avatar asked Jul 31 '09 06:07

Tyler Carter


People also ask

Which jquery selector would you use to select all of the links in a page?

To select all links inside paragraph element, we use parent descendant selector. This selector is used to selects every element that are descendant to a specific (parent) element.

How will you identify visited link in HTML?

You can parse all links on the page and and get their CSS color property. If a color of the link is a match to the color of unvisited link you defined in CSS the this link is unvisited. This kind of technique usually used to determine all visited links.

How do I make visited links different colors?

If it's deselected (by default), you are good. Go to Step 2. Step 2: Now go to Content > Fonts & Colors > Colors. In the “Colors” windows, change the color of “Visited Links:” to your desired one, select Always in the drop-down menu, and click the “OK” button to save your changes.

What does the CSS visited keyword do?

The :visited CSS pseudo-class represents links that the user has already visited. For privacy reasons, the styles that can be modified using this selector are very limited.


1 Answers

The given approach has been disabled for security reasons.

As it is possible to retrieve a visitor's history by checking for visited links, certain measures have been taken by browser vendors to prevent this.

Source: Mozilla Foundation Blog.

Checked in Chrome and FF - both don't support $("a:visited") any longer.

like image 86
panepeter Avatar answered Sep 29 '22 14:09

panepeter