0

To create a nested JSON from a form using serializeArray() in jquery.

For example :

{
    "glossary": {
        "title": "example glossary",
        "GlossDiv": {
            "title": "S",
            "GlossList": {
                "GlossEntry": {
                    "ID": "SGML",
                    "SortAs": "SGML",
                    "GlossTerm": "Standard Generalized Markup Language",
                    "Acronym": "SGML",
                    "Abbrev": "ISO 8879:1986",
                    "GlossDef": {
                        "para": "A meta-markup language, used to create markup languages such as DocBook.",
                        "GlossSeeAlso": ["GML", "XML"]
                    },
                    "GlossSee": "markup"
                }
            }
        }
    }
}
levi
  • 22,001
  • 7
  • 73
  • 74
Chithra Mohan
  • 199
  • 1
  • 2
  • 6
  • 2
    You should add a better explanation of what you want to achieve. Just pasting the raw JSON, with very little else, will make it difficult for people to help you out. – mjuarez Feb 19 '15 at 05:06

1 Answers1

0

All the nested JSON will be treated as an object and can be serialized and deserialized in the same fashion.

For serialize and deserialize you can use these methods for JSON:

JSON.stringify turns an object in to a JSON text and stores that JSON text in a string.

JSON.parse turns a string of JSON text into an object.

Hopefully you can relate this Question to the below as well:
Difference between JSON.stringify and JSON.parse

Community
  • 1
  • 1
Manish Gupta
  • 1,405
  • 14
  • 32