O'Reilly logo

CoffeeScript Programming with jQuery, Rails, and Node.js by Michael Erasmus

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using CoffeeScript and jQuery in the browser

Before we can start playing with jQuery and CoffeeScript, let's talk about how you go about writing CoffeeScript code that runs in the browser.

Compiling CoffeeScript

The most common way of compiling CoffeeScript for a web application is to run the coffee command to watch one or more CoffeeScript files for changes and then to compile them to JavaScript. The output will then be included in your web application.

As an example, we'll organize our project folder structure to look something like the following folder structure:

Compiling CoffeeScript

'

The src folder is where your CoffeeScript files would go. We could then start a CoffeeScript ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required