Motyar

Displaying JSON values with JavaScript : Basics of JSON Template with JavaScript

Today morning I came through the knockout.js. I liked the idea of JSON Templating. You can read more about JSON Template in this post - "Introducing JSON Template".

I love JSON, because its light weighted and you can parse it easily any programming language. I wrote a simple prototype to display JSON data in HTML using JavaScript Template. I hope it will help you to understand the mechanism.

I took an example of Facebook graph API to show user information. In this template you can change the data attribute of the element to show the key value from JSON object returned from API.


Here is the code


You can see the working demo here.
I am on twitter @motyar.

Labels: , , , ,


By :