O'Reilly logo

HTML5 Data and Services Cookbook by Mite Mitreski, Gorgi Kosev

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

Rendering objects using Jade

Jade is a clean, terse template language. It uses significant whitespace to denote block and element hierarchy. It supports many advanced features, for example, mixins, which are subtemplates and blocks, which are template sections replaceable by inheritance.

In this recipe, we're going to render a simple greeting using Jade. Later on in this chapter, we're going to look at some of the more advanced features.

Getting ready

We need to download jade.min.js in our recipe folder, available at https://github.com/visionmedia/jade.

How to do it...

Let's get started.

  1. Create index.html, it will contain a small form asking the user for his or her name, a placeholder to render the greeting, and the greeting template:
    <!DOCTYPE HTML> ...

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