Important changes to Tiny Cloud pricing > Find out more

tinymce.util.JSON

JSON parser and serializer class.

Examples

// JSON parse a string into an object
var obj = tinymce.util.JSON.parse(somestring);

// JSON serialize a object into an string
var str = tinymce.util.JSON.serialize(obj);

Methods

name summary defined by
parse() Unserializes/parses the specified JSON string into a object. tinymce.util.JSON
serialize() Serializes the specified object as a JSON string. tinymce.util.JSON

Methods

parse

parse(s:string):Object

Unserializes/parses the specified JSON string into a object.

Parameters
  • s (string) - JSON String to parse into a JavaScript object.
Return value
  • Object - Object from input JSON string or undefined if it failed.

serialize

serialize(obj:Object, quote:String):string

Serializes the specified object as a JSON string.

Parameters
  • obj (Object) - Object to serialize as a JSON string.
  • quote (String) - Optional quote string defaults to ".
Return value
  • string - JSON string serialized from input.

Can't find what you're looking for? Let us know.

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.