Need help with jquery-jsonview?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

yesmeck
472 Stars 148 Forks 81 Commits 15 Opened issues

Description

[UNMAINTAINED]View JSON in a more readable format

Services available

!
?

Need anything else?

Contributors list

# 213
React
ant-des...
Less
json-vi...
62 commits
# 256
echarts
TypeScr...
html5
ionic
3 commits
# 27,838
aws-lam...
aws-s3
graphql...
hand-po...
2 commits
# 64,622
HTML
ranger
range-p...
Shell
1 commit
# 457,981
HTML
CSS
jquery-...
json-vi...
1 commit
# 168,146
Objecti...
HTML
jquery-...
json-vi...
1 commit
# 447,128
microfr...
HTML
CSS
json-vi...
1 commit
# 459,261
HTML
CSS
jquery-...
json-vi...
1 commit

jQuery JSONView

Formats & syntax highlights JSON.

Port of Ben Hollis's JSONView extension for Firefox: http://jsonview.com

Live demo

Usage

Example

var json = {"hey": "guy","anumber": 243,"anobject": {"whoa": "nuts","anarray": [1,2,"thr

ee"], "more":"stuff"},"awesome": true,"bogus": false,"meaning": null, "japanese":"明日がある。", "link": "http://jsonview.com", "notLink": "http://jsonview.com is great"};

$(function() { $("#json").JSONView(json); // with options $("#json-collasped").JSONView(json, { collapsed: true }); });

Options

jQuery JSONView can be configured using the following options.

  • collapsed
    - Collapse all nodes when rendering first time, default is
    false
    .
  • nl2br
    - Convert new line to

    in String, default is
    false
    .
  • recursive_collapser
    - Collapse nodes recursively, default is
    false
    .
  • escape
    - Escape HTML in key, default is
    true
    .
  • strict
    - In strict mode, invalid JSON value type will throw a error, default is
    false
    .

API

jQuery JSONView provide following methods to allow you control JSON nodes, all methods below accept a level argument to perform action on the specify node.

  • jQuery#JSONView('collapse', [level])
    - Collapse nodes.
  • jQuery#JSONView('expand', [level])
    - Expand nodes.
  • jQuery#JSONView('toggle', [level])
    - Toggle nodes.

Licence

MIT

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.