Building our application
In Chapter 1, Running a CoffeeScript Program, we tested our CoffeeScript compiler by creating a bare-bones web page for a small pet shop. It's time to revisit that code, but we're more ambitious now. The first thing we need to do is use the page to display a list of available pets. Here's our index.html
:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>The Pet Shop</title> <link href="style.css" media="screen" rel="style sheet" type="text/css" /> </head> <body> <h1>Welcome to <span id="owner_name"></span>'s Pet Shop</h1> <p>We have some lovely pets available for the right owner to take home today. Please have a look at our selection.</p> <ul id="available_pets"> </ul> <script src="setup.js"></script> </body> </html>
It's much the same as our original version, but we've linked the code...