A
A
Anton2020-04-15 21:46:34
JavaScript
Anton, 2020-04-15 21:46:34

How to disable link opening on .on('click') event?

I have an ajax link handler on my site. $('body').on('click','.ajax_post', function () {}, but when clicking on a link, if the url in href is specified there, the link is opened, not the content in the container. As when clicking on this link, prevent the link from opening as a new page?
The site is for radio, and I can't let all scripts load again.
At the same time, I can't do without the href parameter, because I want to allow search engines to see what this link leads to to such a page.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Froggyweb, 2020-04-15
Veida @aveyda7

.stopPropagation()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question