Book Image

CoffeeScript Application Development Cookbook

By : Mike Hatfield
Book Image

CoffeeScript Application Development Cookbook

By: Mike Hatfield

Overview of this book

Table of Contents (18 chapters)
CoffeeScript Application Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Working with jQuery


jQuery is undoubtedly one of the most widely used JavaScript libraries in use today. It alone is used by nearly 57 percent of all websites in the world and has a whopping 92 percent market share in the JavaScript library space.

Tip

For more information on jQuery, you can visit the project home page at http://jquery.com/.

In this section, we will look at writing jQuery code to use with jQuery and some of jQuery's most popular plugins.

Executing on load

When a web page first loads, jQuery will trigger a document.ready event allowing you to execute code before the page begins rendering. This is the opportune time to execute any initialization code.

Getting ready

Our jQuery examples will be based on a basic HTML file with the following structure:

<!doctype html>

<html lang="en">

<head>
  <meta charset="utf-8">
  <title>jQuery Examples</title>
</head>

<body>

  <!-- Your CoffeeScript code goes here -->
  <script type="text...