开发者

What is wrong with my jquery code for cancelling a href? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

This question does not appear to be about programming within the scope defined in the help center.

Closed 9 years ago.

Improve this question 开发者_StackOverflow中文版

http://jsfiddle.net/W59sw/3/

When someone clicks on the button, I want to prevent the page from redirecting, and do some custom stuff. What am I doing.


You forgot to include jQuery in your jsFiddle. There is nothing wrong with your code.


You loaded MooTools and not jQuery on the jsFiddle


You need to select jQuery on the left, not MooTools.


Your code works fine, but your jsFiddle is not loading jQuery. Also note that in this case you probably don't need to preventDefault() and should just use return: false;

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜