当前位置: 首页 > 文档资料 > tinyMCE 帮助文档 >

tinymce-util-JSON

优质
小牛编辑
123浏览
2023-12-01

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

namesummarydefined 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.