Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> What Is Json? ,how It Works?
magiccode9
post May 16 2006, 08:43 AM
Post #1


Premium Member
********

Group: Members
Posts: 162
Joined: 1-November 05
From: SATA II
Member No.: 13,683



hi, I have found a term called JSON, it's Javascript Object Notation. After go through few web pages still dont get what it is? This is what it described :

QUOTE
JSON , which stands for "JavaScript Object Notation", is a lightweight computer data interchange format. JSON is a subset of the object literal notation of JavaScript but its use does not require Javascript.

JSON's simplicity has resulted in its widespread use, especially as an alternative to XML in Ajax. One of the claimed advantages of JSON over XML as a data interchange format in this context is that it is much easier to write a JSON parser. In JavaScript itself, JSON can be parsed trivially using the eval() procedure. This was important for the acceptance of JSON within the Ajax programming community because of JavaScript's ubiquity among web browsers.


Anyone who know what it is ? Could give me few examples ?
Only know how it contructs, but dont how to call and use it !!!


Thanks you !!!
Go to the top of the page
 
+Quote Post
Saint_Michael
post May 16 2006, 04:52 PM
Post #2


$p4m 0n j00 $h4m3 m3 0nc3 $p4m 0n m3 $h4m3 m3 7\/\/1c3
*********************

Group: [HOSTED]
Posts: 6,314
Joined: 21-September 04
From: 9r33|\| 399$ 4|\|D 5P4/\/\
Member No.: 1,218
T17 GFX Crew



well from reading that little passage, by the looks of it, its another way to use javascript on your site and not have to worry about people having it turned off since doesn't require javascrpt tags to actually run it.

Also by looking at some other sites it make programing in javascript quicker and more effective.

havn't found any real scripts on the met myself. Ubt if I were to conclude that json is a server side coding for large amounts of info. But i think its a water down version of ajx and xml as well.
Go to the top of the page
 
+Quote Post
hyuken
post Jun 16 2006, 04:09 PM
Post #3


Newbie [Level 1]
*

Group: Members
Posts: 11
Joined: 14-June 06
Member No.: 25,147



I've use JSON for my PHP application.

JSON make easy to interchange between programming language to JavaScript,
Based what i've done, JSON is class/library that we can use to (ex:) convert
a variable from PHP variable to JavaScript Variable.

As Example : we have an array and we want to use the array in JavaScript

CODE

<?php
$myArray = Array('a'=>'the first', 'b'=>'is second');

$json = new JSON();

echo $json->convert($myArray);
?>


returned/print :

CODE
{a:'the first', b:'is second'}
blink.gif biggrin.gif biggrin.gif

I hope it could help you. biggrin.gif
Go to the top of the page
 
+Quote Post
sonesay
post Jan 31 2008, 07:20 PM
Post #4


|||[ n00b King ]|||
*********

Group: [HOSTED]
Posts: 643
Joined: 20-June 07
From: Auckland
Member No.: 45,102



Ever try and read through some javascript framework source code and see blocks and blocks of code nested in each other then get confused at why its like that? Thats JSON. I was trying to read documentation on a javascript framework last night and came across JSON again. This time I actually got a link to a useful article that explains what it is and how its used.

when your script contains 100's of functions it will be too confusing to look at each function and determine what it does and where its related to. With JSON you can group functions into an object this also helps with naming conflicts since it will have its own scope. Also if your working in teams this helps also with the naming conflicts.

If you use alot of javascript and your not using JSON your serisouly limiting yourself IMO, Learning to write javascript in JSON is very simple and once you get used to the structure you will be enjoying writing cleaner javascript code. It will also help you reading code used in javascript frameworks.

a must read introduction to JSON
http://www.dustindiaz.com/json-for-the-masses/

more reference and structure diagrams for JSON
http://www.json.org/

Go to the top of the page
 
+Quote Post
hippiman
post Feb 2 2008, 06:13 PM
Post #5


Premium Member
********

Group: Members
Posts: 150
Joined: 9-April 07
From: Nebraska
Member No.: 41,301



I think it just parses objects from different web languages into a string, and when you include the JSON libraries for whatever language you're using, you can take that string and make it an object of whatever type you need.

I came across it a while ago, but I never ended up using it, because I never get that far into making anything. I'll probably look into it farther now, though, because you reminded me of it.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. [help] Java Script: Window.open(8)
  2. Simple Firefox Vs. Ie Script Bug; Need A Little Help(3)
  3. Javascript Error(2)


 



- Lo-Fi Version Time is now: 26th July 2008 - 06:09 PM