Class JavaScriptSerializer

Serializes JavaScript types into JSON-formatted data and deserializes JSON-formatted data into JavaScript types The JavaScriptSerializer class contains only static methods.

see

{@link http://msdn.microsoft.com/en-us/library/bb310857(v=vs.100).aspx}

Index

Constructor methods

Methods

Constructor methods

constructor(): JavaScriptSerializer

Initializes a new instance of the Sys.Serialization.JavaScriptSerializer class.

Returns

JavaScriptSerializer

Methods

public static deserialize(value: string): any

Converts a JSON string into an ECMAScript (JavaScript) object graph. This member is static and can be invoked without creating an instance of the class.

static

Parameters

  • value: string
          The JSON string to deserialize.
    

Returns

any

public static serialize(value: any): string

Converts an ECMAScript (JavaScript) object graph into a JSON string. This member is static and can be invoked without creating an instance of the class.

static
exception

Sys.ArgumentException value contains a value that cannot be serialized.

Parameters

  • value: any
          The JavaScript object graph to serialize.
    

Returns

string