jquery-jsonview

WebJar for jquery-jsonview

License

License

MIT
Categories

Categories

JSON Data
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

jsonview
Last Version

Last Version

1.2.3
Release Date

Release Date

Type

Type

jar
Description

Description

jquery-jsonview
WebJar for jquery-jsonview
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/yesmeck/jquery-jsonview

Download jsonview

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/jsonview/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>jsonview</artifactId>
    <version>1.2.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/jsonview/
implementation 'org.webjars.bower:jsonview:1.2.3'
// https://jarcasting.com/artifacts/org.webjars.bower/jsonview/
implementation ("org.webjars.bower:jsonview:1.2.3")
'org.webjars.bower:jsonview:jar:1.2.3'
<dependency org="org.webjars.bower" name="jsonview" rev="1.2.3">
  <artifact name="jsonview" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='jsonview', version='1.2.3')
)
libraryDependencies += "org.webjars.bower" % "jsonview" % "1.2.3"
[org.webjars.bower/jsonview "1.2.3"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bower : jquery jar [0,)

Project Modules

There are no modules declared in this project.

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<h1>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 <br> 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

Versions

Version
1.2.3