I was implementing pjax. However, the href attribute on the link tag still works. preventDefault() with addEventListener; I also tried to apply return false; as well. How can I prevent the href tag from working?
My code: (link is a predefined function that sends pjax as an argument value. It is simply sent, so it doesn't matter here.)
document.querySelectorAll('a').forEach(addEventListener('click', function(){
preventDefault();
link(location.pathname);
};);