tinymce.util.JSON

JSON parser and serializer class.

JSON has been deprecated in TinyMCE 5.10 and has been marked for removal in TinyMCE 6.0. Use the native browser JSON API instead.

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);

Summary

Methods

Name Summary Defined by

parse()

Unserializes/parses the specified JSON string into a object.

JSON

serialize()

Serializes the specified object as a JSON string.

JSON

Methods

parse()

parse(text: string): Object

Unserializes/parses the specified JSON string into a object.

Parameters

  • text (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): string

Serializes the specified object as a JSON string.

Parameters

  • obj (Object) - Object to serialize as a JSON string.

Return value

  • string - JSON string serialized from input.