Gadgets.json (v0.9)

From VZ Developer Wiki
Jump to: navigation, search

This documentation is not completed yet and will be extended by more examples in future.

gadgets.json

Provides operations for translating objects to and from JSON.

Methods

gadgets.json.parse

<static> Object gadgets.json.parse(text)
Description
Parses a JSON string, producing a JavaScript value.
Example

gadgets.json.stringify

<static> String gadgets.json.stringify(v)
Parameters
Name Type Description
v Object The object to convert
Returns
Type Description
String The JSON equivalent
Description
Converts a JavaScript value to a JSON string.
Example
gadgets.json.stringify({a : "b"})

Examples

var original = { "string" : "value",
                 "number" : 42,
                 "array"  : [1,2,3] };

var json = gadgets.json.stringify(original);
// json == '{"string":"value","number":42,"array":[1,2,3]}'

var jsObject = gadgets.json.parse(json);
// jsObject["string"] == "value"
// jsObject["number"] == 42
// jsObject["array"] == 1,2,3


OpenSocial (v0.9)

gadgets

gadgets.io

gadgets.json

gadgets.Prefs

gadgets.util

gadgets.views

gadgets.flash

gadgets.MiniMessage

gadgets.oauth.Popup

gadgets.rpc

gadgets.skins

gadgets.pubsub

gadgets.Tab

gadgets.TabSet

gadgets.window

gadgets.i18n

opensocial

opensocial.Activity

opensocial.Address

opensocial.Album

opensocial.BodyType

opensocial.Collection

opensocial.CreateActivityPriority

opensocial.DataRequest

opensocial.DataResponse

opensocial.Email

opensocial.Enum

opensocial.Environment

opensocial.EscapeType

opensocial.IdSpec

opensocial.MediaItem

opensocial.Message

opensocial.MessageCollection

opensocial.Name

opensocial.NavigationParameters

opensocial.Organization

opensocial.Permission

opensocial.Person

opensocial.Phone

opensocial.ResponseItem

opensocial.Url

osapi.Request

osapi.BatchRequest

osapi.people

osapi.activities

osapi.appdata

osapi.messages

osapi.http