Using a third-party library

For the sake of simplicity, we have so far refrained from using any third-party libraries. Now, however, we're going to pull in a library to help us make remote web requests. In the process, we'll also experience just how easy it is to integrate our CoffeeScript with a third-party library written in JavaScript. Reqwest is a small, focused library built specifically to help with AJAX requests, so it's perfect for us.

Note

To learn more about Reqwest, visit the project page at https://github.com/ded/Reqwest.

First, download the library from https://github.com/iangreenleaf/reqwest/raw/coffeescript_book/reqwest.js. Put this file in our application's directory and name it reqwest.js. Now we'll include it at the beginning of ...

Get CoffeeScript Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.