JQuery JSON Plugin - Convert JSON to String and back again

  • Tags : ajax, javascript, jquery, json
  • Latest : 2.2.2
  • Last Updated: 05 May 2011
  • Grails version : 1.2.2 > *
  • Authors : Lim Chee Kin
0 vote
Dependency :
compile ":jquery-json:2.2.2"

Documentation

Summary

Description

Overview

This plugin simply supplies jQuery JSON resources, and depends on the jQuery plugin to include the core jquery libraries.

Use this plugin in your own apps and plugins to avoid resource duplication and conflicts.

Note for developers working with this plugin

This plugin just provides the resources and a tag to include them. It must not include tags to add new functionality or wrap jQuery JSON features.

If you need a newer version of jQuery JSON than is currently available with this plugin you can update this plugin in grails SVN yourself. The original author has no desire to manage releases - provided you follow the clear conventions set out, all users of this plugin will be happy! Be my guest and release new versions as and when - just don't break anything for existing users. That means:

  • Always include all jQuery JSON resources such as jquery.json-2.2.js and jquery.json-2.2.min.js.
  • Don't add any functionality tags to this plugin
  • Only update the jquery core library dependency when absolutely necessary, i.e. when jQuery JSON requires it.
IMPORTANT: Make sure the version number of the plugin and the jQuery JSON distribution is the same.

Conventions

The version number of this plugin must always follow the version number of the jQuery JSON version it bundled.

E.g. the first release of this plugin is 2.2 - because it ships jQuery JSON 2.2. If jQuery JSON upgrades to 2.3 or similar, this plugin would need to be upgraded to use it and use the version number 2.3.

The key part is that any apps/plugins can install or dependsOn "jqueryJson" of a given version e.g. 2.2 to pull in that version of jQuery JSON.

This plugin must dependsOn the minimum version of jQuery required by the jQuery JSON version. E.g. in this release that is jQuery 1.3.2 which is a separate grails plugin that also matches this versioning convention

Tags

There is one tag - <jqJson:resources/> - which pulls in the resources needed. It does not currently pull in the core jQuery resources, you should use the <g:javascript lib="jquery"/> tag for that.

Configuration

Minified version of Javascript file

You can choose if the minified version of the .js shoud be used (or not) by adding the following config parameter to your project's Config.groovy:

jqueryJson.minified = true|false

default: serve minified