Skip to content
deltachaos edited this page Mar 20, 2011 · 4 revisions

App

Core metodes of the App object

Examples

Json encode

This example show how to encode a JavaScript Object to a Json String.

Note: This Metode try's to use the json2.js library and fallback to native support ({foo: 'baa'}).toSource() if exists

	alert(App.jsonEncode({
		foo: baa
	}));
	/* This shows a alert with: '{"foo":"baa"}' */

Json decode

This example show how to decode a Json String to it's JavaScript representation.

Note: This Metode try's to use the json2.js library and fallback to jQuery.parseJSON() or eval()

	var obj # App.jsonDecode('{"foo":"baa"');

Metodes

jsonEncode

	App.jsonEncode(value, space, reviver)

Note: See json2.js for details

jsonDecode

	App.jsonDecode(text, reviver)

Note: See json2.js for details

Clone this wiki locally