I\'m having trouble using the event.preventDefault();
for an ahref
on my DOM.
How do you prevent the url from posting a nofollow delete, as spe
I faced the same issue, but failed to get any good solution after breaking my head for hours. So, based on the suggested answers here, I did something like:
function enableLink() {
jQuery("#link_id").removeClass("disabled");
jQuery("#link_id").attr("data-remote", true);
}
function disableLink() {
jQuery("#link_id").addClass("disabled");
jQuery("#link_id").removeAttr("data-remote");
}
jQuery(document).ready(function(){
jQuery(document).on("click", "disabled", function(e){
e.preventDefault();
});
});
I accept it's not a good workaround. But, thats what helped me.