NOTE: TinyMCE 5 reached End of Support in April 2023. No more bug fixes, security updates, or new features will be introduced to TinyMCE 5. We recommend you upgrade to TinyMCE 6 or consider TinyMCE 5 Long Term Support (LTS) if you need more time.
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);
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(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.
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.