.on() does not appear to function like .live(). All I want to do is a simple alert to get me going. I have the following element on my page:
<a class="add_showcase_item" href="javascript://">621015</a>
I have the following CoffeeScript:
$("a").live "click", ".add_showcase_item", ->
alert "hello"
false
Unfortunately, this causes the alert to go off on EVERY link. That doesn’t make any sense I know. Can anyone help?
As the jQuery docs say, you need to specify the delegate, and then as an argument you provide the actual selector you want to listen on: