Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
May 13, 2014 06:03 pm GMT

jQuery with CoffeeScript

I don't always write CoffeeScript, but when I do, I'm probably using jQuery too I always forget the syntax for stuff. So I'm going to write it all down here so I can reference it until I memorize it.

Note that the compiled example doesn't include the automatic closure around everything you get in CoffeeScript.

Safe jQuery Closure

So you can use the $ safely (common in WordPress):

(($) ->

) jQuery
(function($) {

})(jQuery);
DOM Ready
$ ->
console.log("DOM …


jQuery with CoffeeScript is a post from CSS-Tricks


Original Link: http://css-tricks.com/jquery-coffeescript/

Share this article:    Share on Facebook
View Full Article

CSS Tricks

A Web Design Community curated by Chris Coyier

More About this Source Visit CSS Tricks