I have a situation where I am listing WordPress posts, and when I click on a title, jQuery is loading the single post page for me via ajax. However, I don't want this behavior - I just want the link to act normally. I have tried using the following code:
$('article a').click(function(event){
event.preventDefault();
//also possible
event.stopImmediatePropagation();
});
Unfortunately, this solution did not work. I also attempted to use data-role="none"
and data-enhance="false"
attributes on the <a>
element, but still no luck.
One alternative could be to listen for the click event with jQuery and then manually change the window location, but this seems like a cumbersome solution.
Does anyone have any other suggestions or solutions to this problem?