Answer the question
In order to leave comments, you need to log in
How can I send the text of the link to the server when I click on it?
How can I send the title of the article to the server? It is impossible to enter the name in the parameters for each link in the href, because a lot of articles
Answer the question
In order to leave comments, you need to log in
How do you fill in the site manually?
"You can't enter the name in the parameters for each link in the href, because there are a lot of articles" - it is necessary just so that the server generates these href as it needs
Well, in general, we hang a regular listener on links. Below I threw an example when with a comment.
// This way we can get the text of all links
// If necessary, then limit the choice of the necessary links, for example, by class
// Further, you can already work with the hrefText variable. Send an ajax request to the server.
https://pastein.ru/t/zX
But there I indicated a cycle for all links. Accordingly, in your case, hang onClick in a similar way to pull out the link text.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question