JSONplus by Josip Kalebic | JavaScriptSource

JSONplus by Josip Kalebic

Josip Kalebic Jun 4, 2012

Abstract

JSONplus is regular JSON data format extended with functions as data type. Such format is in fact JavaScript Object Literal without variable declaration.

Description

SONplus is regular JSON data format extended with functions as data type. Such format is in fact JavaScript Object Literal without variable declaration. Function as a data type in JSON format is not approved by "json.org"! Functions are the only data type that is missing in JSON format to become a real JavaScript literal object. Safety is not compromised because the object does not have the variable declaration and as such is harmless. Once the object is declared, the user decides whether to only use data from the object or use object function.

Code Snippet

{
    "title": "JSONplus",
    "foo": function (a, b){ 
                alert(a + b); 
            },
    "array": [1,2,3,4,5]
    "boolean":true
}

Leave a Response

(0 comments)