Whitebeam Object Definition

Site Map
 
Home
 
Application Guide
Reference
  Installation
  Configuration
  XML Markup
  JavaScript Classes
  ROM
  Templates
  Environment
  Dev Process
  Tools
  External Links
  Example libraries
Community
Contact Whitebeam
To-Do
Download
Credits
Licence
Whitebeam Users
 
 
 

Whitebeam Object Definition

JSONexp Object Description

The JSONexp object holds two methods: 'stringify' and 'parse'. For most practical purposes these methods are drop in replacements for the 'standard' JSON encoder and decoders previously used by Whitebeam authors written in Javascript. With the rise of JSON as a popular web interchange language for web applications this native 'C' implementation offers significant resource savings and performance gains.

Generally to use this implementation in an application simply replace the JavaScript implementation with:

var JSON = JSONexp;

There are a couple of differences with the standard implementation:

  • JSONexp.parse takes a single parameter, which is the string to be parsed. The Javascript implementation allows a second parameter which is a function which is called for each value to provide additional decoding. This is slow!
  • JSONexp.parse checks decoded string values for a valid date format. If it looks like a date then the datre object is correctly decoded. This is the most common use of the unsupported second parameter to JSON.parse.

Methods

JSONexp.stringify() Serialise a Javascript 'thing' as an IETF RFC 7159 conformant serialisation
JSONexp.parse() A re-constructed Javascript 'thing' extracted from the JSON serialisation
Whitebeam release 1.3.36
(loadtime : 19ms)