On my wordpress website i have a calendar page managed by a plugin installed which has some basic links in it <a class="mylink" href="http://myurl.com">Some text</a>
.
Somewhere in that plugin there is some Javascript code that once the user clicks on one of those links triggers an AJAX call. Well, I don't want this to happen. And, of course, i don't want to edit the plugin core files.
What i want to do is to simply create a script that removes any action bound to those links so that once the user clicks on one of those links nothing happens.
So, i tried with jQuery methods preventDefault()
, stopPropagation()
and stopImmediatePropagation()
, but none of them worked.
jQuery(document).on('click','.mylink', function(event){
event.preventDefault();
event.stopImmediatePropagation();
event.stopPropagation();
//do the stuff i want here
});
What am i missing?