jQuery Plugin To Format & Beautify JSON Data - jsonfrill

File Size: 9.24 KB
Views Total: 3618
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
jQuery Plugin To Format & Beautify JSON Data - jsonfrill

jsonfrill is a jQuery plugin that helps you render a collapsible, colored JSON tree view by formatting and beautifying JSON data.

How to use it:

1. Load the jQuery JavaScript library and the jQuery jsonfrill plugin's files in the document.

<link href="src/jsonFrill.css" rel="stylesheet">
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>     
<script src="src/jsonFrill.js"></script>

2. Render a tree view from JSON data embedded in a container.

$('#container').jsonFrill();

3. Render a JSON tree view from an external data source.

$('#tcontainer').jsonFrill(sourceJson);

4. Pass the options to the JSON tree view.

$('#tcontainer').jsonFrill(sourceJson,{

  // collapsible?
  collapse: false,

  // display collapse all and expand all buttons
  toolbar: false,

  // tab size
  tabSize: 2
  
});

This awesome jQuery plugin is developed by sparuvu. For more Advanced Usages, please check the demo page or visit the official website.