JQuery: mark links as visited without opening them?

I have no intention of just changing the link (I hear this is impossible, but if I don’t want to know how to do it). I am fine by adding it to your browser history if you need to do this.

I would like to skip everything <a>on the page and change their state to visit. For example:

$("a").each(function(){
   //mark as visited (somehow?)
});

Essentially creating a “Mark all as read" button on my page. Any ideas?

+3
source share
3 answers

Could you...

1) Try using AJAX (i.e. $ .get (a.href)), but I don't know if this really works.

2) ( "CSS" ),

3) , - :

3A) IFRAME

3B) A , IFRAME

3C) $( "a" ). click() (, - , )

, , .

+2

(.. href window.location) .

+3

, , CSS: "" - , .

$('a').addClass('visited');
0
source

Source: https://habr.com/ru/post/1726496/


All Articles