ECMA has approved the 5th edition of ECMAScript. This includes the native support of JSON. This will help in using JSON in more secure way and it will also allow faster parsing of JSON. JSON is used widely as data interchange format. It is used in place of XML. Many think that XML is overly loaded and [...]
JSON is in use for data interchange format. It is accepted in many programming language whether client side or server side language. So, learning JSON and using it securely is needed.
Both JavaScript and PHP has in-built functions for this.
JSON parser function is useful if your JSON text is coming from external source for security of [...]
JavaScript Object Notation (JSON) is a data-interchange format. JSON text format is familiar to programmers of many languages. JSON object is a valid JS, so it can be used directly.
JSON structures:
1. {Key1: value1, Key2: value2,…}
2. [Value1, value2,…]
Key can be string. This can take any characters except “, \ and control-characters.
Value can be string, number, object, [...]
Javascript do not have associative array like PHP. In PHP you may have enjoyed associative array.
Here is something similar to associative array in JavaScript. But as it is not an associative array, so you cannot use JavaScript array methods. It is JSON style Object representation.
<script type=”text/javascript”>
var salesPerson = { “firstName”: “crockford”,
[...]