Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yesmeck/jquery-jsonview
[UNMAINTAINED]View JSON in a more readable format
https://github.com/yesmeck/jquery-jsonview
jquery-jsonview jquery-plugin json-viewer
Last synced: about 2 months ago
JSON representation
[UNMAINTAINED]View JSON in a more readable format
- Host: GitHub
- URL: https://github.com/yesmeck/jquery-jsonview
- Owner: yesmeck
- Archived: true
- Created: 2012-12-23T18:10:19.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-10-09T07:00:50.000Z (about 7 years ago)
- Last Synced: 2024-05-22T18:31:36.305Z (7 months ago)
- Topics: jquery-jsonview, jquery-plugin, json-viewer
- Language: CoffeeScript
- Homepage: http://yesmeck.github.io/jquery-jsonview/
- Size: 104 KB
- Stars: 490
- Watchers: 25
- Forks: 157
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jQuery JSONView
Formats & syntax highlights JSON.
Port of Ben Hollis's JSONView extension for Firefox: http://jsonview.com
[Live demo](http://yesmeck.github.io/jquery-jsonview/)
## Usage
### Example
```javascript
var json = {"hey": "guy","anumber": 243,"anobject": {"whoa": "nuts","anarray": [1,2,"three"], "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](http://opensource.org/licenses/MIT)