JSON Object (JavaScript)

An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. The JSON.stringify function serializes a JavaScript value to JSON text. The JSON.parse function deserializes JSON text to produce a JavaScript value.




Required. Name of one of the methods of the JSON object.


You cannot create a JSON object by using the new operator. An error occurs if you try to do this. However, you can override or modify the JSON object.

The scripting engine creates the JSON object when the engine is loaded. Its methods are available to your script at all times.

To use the intrinsic JSON object, make sure that you do not override it with another JSON object that is defined in your script. You may need to modify existing script statements that detect the presence of a JSON object because those statements will evaluate differently. This is demonstrated in the following example.

if (!this.JSON) {  
    // JSON object does not exist.  

In the previous example, !this.JSON evaluates to false in Internet Explorer 8 standards mode, Internet Explorer 9 standards mode, Internet Explorer 10 standards mode, Internet Explorer 11 standards mode, and win8_appname_long apps. Therefore, the code inside the if statement does not execute.


JSON.parse Function

JSON.stringify Function


Supported in the following document modes: Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Also supported in Store apps (Windows 8 and Windows Phone 8.1). See Version Information.
Not supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards.

See Also

toJSON Method (Date)
JavaScript Objects
Hub template sample app (Windows Store)