开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜