Hi
This is a bit sticky situation, and I need some advice.
I have a couple href like this in my project.
<a class="not-allowed" href="javascript:void(0)" onclick="showSettingDiv();">Change</a>
<a class="" href="javascript:void(0)" onclick="DeleteSettingDiv();">Delete</a>
Depending on the type of login, I have to have some links, do nothing, and run something else.
I have this function to make this happen:
$('.not-allowed').each(function (e) {
$(this).click(function (e) {
e.preventDefault();
alert("you dont have permission");
})
});
This activates a warning, however it also performs my onclick function. is there a way i can stop all javascript functions and execute only this above one?
I realized that I could just use it .removeAttr()
, but I'm not sure if this is the best way. I mean, I can have buttons for a restriction or a checkbox and a switch for disabling.
e.preventDefault
will not take care of everything that I suppose. In any case, how to prevent all javascript functions?
Thank.