Another quick one – how to stop a link from doing anything. I’ve just come across a need to use a link that acts as a button. A slight UI issue with this is that clicking a hyperlink will with an href value of ‘#’ will push scroll to the top of the page.
There are a couple of ways to go about fixing this. Note the href value in the following:
The second option is probably already familiar to anyone using ajax forms, simply have your function return false:
1 2 3 4 5 6 7 8 9 10 11 12
The third option is simply a jQuery-ish rehash of number 2:
1 2 3 4 5 6 7 8