Jquery: stopping navigation into link when it has javascript embeded
When I am dealing with links with Javascript embeded,
<a onclick="return tnNav2Evt391(this,'');" href="#" class="">link</a>
I want to stop the execution of Javascript and highlight it.
With normal links without Javascript embeded, I am able to stop default navigation:
function processAction(e){
var clicked = e.target;
switch(clicked.tagName)
{
case "A":
return false; // prevent the default action, e.开发者_运维技巧g., following a link
break;
}
}
try
$('a').removeAttr('onclick').click(function(event) {
event.preventDefaut();
//write the logic herer
});
It'll prevent click default event.
精彩评论