Miva-JSON Conversions

by Kent Multer, Magic Metal Productions

Copyright © 2011 by Kent A. Multer

The demo will convert JSON text into a Miva structured variable, and then convert the variable back into JSON.

Try it!   Enter some JSON text in the box, or  

Show debugging info

JavaScript Object Notation (JSON) is a language for describing data, similar in principle to XML, but more concise. It's a handy way for apps to pass data back and forth, and is widely used on the Web. It includes support for arrays with numbered elements, and for structures with named elements, much like Miva Script.

Here are a couple of Miva Script functions for converting between JSON and Miva Script variables. Both functions will work with any type of data: arrays of structures, structures with multiple levels of nesting, etc.

View or download the source code here.

A few implementation notes:

More information is available at JSON.org.

Please with any bug reports, questions, etc. Thanks! — Kent