06 August 2014

Recently I searched preventDefault() in a whole project, I found some of them like

$('.a-btn').on 'click', (event) ->
  event.preventDefault()
  # blahblahblah..
$('.another-btn').on 'click', (event) ->
  event.preventDefault()
  # blahblahblah..

I guess you are using a links in a non default way. But we better bind it globally in the DOM, and delegate it to body because if the dom element is created after page load that may not work properly.

$('body').on 'click', 'a[href="#"]', (e) ->
  e.preventDefault()