I am studying json and i was wondering if this is the right way to write a multi dimensional json object that is nested.I wrote:
var foo = {
\"logged_in\":tr
Don't write JSON. Seriously, except for simple configuration files, don't write JSON.
You have utilities to convert objects to a JSON string in most languages (if not any).
PHP: json_encode($array);
Javascript: JSON.stringify( obj );
Etc.
Writing JSON manually often leads to syntax errors. The kind that gives you headaches until you see that missing comma or w/e. You have good tools to do this, use them. You could compare to XML, but JSON has no tool (IDEs, text editor) saying "This syntax is wrong" while you're typing it. For example, no editor will tell you that you used a single quote instead of a double.
Just don't write JSON.