I have many loops in my coffee pot that iterate over a set of DOM elements and do more jQuery. These features tend to look like this:
$('.iterable.object').each ->
$(@).doThis
$(@).doThat
$(@).jqueryPluginCall
x: $(@).data('attr1')
x: $(@).data('attr2')
$(@).children('ul.animateable').each ->
if $(@).data('animation') is "fancy"
$(@).animate fancy: animation
else
$(@).animate simple: animation
$(@).focus(
->
$(@).animate some: more
, ->
$(@).animate even: more
)
I made about 3 typos, typing $(@).over and over again, and it becomes a pain.
Shortcut syntax for $(@)missing? This is a kind of pain to type in and seems to be a fairly common syntax. It would be great if it worked similarly @as an automated caller, for example &doThisinstead &.doThis.
EDIT:
javascript jQuery, DOM & &doThis, , @bennedich .