2011-10-15 27 views
0

我不知道标题是否有意义,但代码值得一个thousound字!jquery捕获后执行href

这里是:

a href="http://twitter.com/intent/tweet?url=http://campaignmonitor.com/blog&text=I love the Campaign Monitor blog!&via=campaignmonitor&related=yarrcat" id="tweeter">Tweet it</a> 

和我有一个jquery按钮捕获事件点击:

$('#tweeter').click(function(){ 
    do some var loading 
    and do some validation... and then.. execute the href ! 
}); 

其实我喜欢的jQuery函数里面做的HREF ...然后执行...可能是一个href =“#”

问题,我如何说jQuery功能....执行href!

+0

代码的实际价值约为单词的1/78。 – Ryan

回答

1
$('#tweeter').click(function(e){ 
    do some var loading 
    and do some validation... 
    if validation fails then e.preventDefault() 
    else don't do anything as the browser will continue and redirect to the link 
});