To Mr. Joe Average web developer JSON may just seem like yet another pointless buzzword but to the enquiring mind it is so much more!
For me, the opportunities JSON presents are much more appreciated when looking at JSONP, a slight variation which stands for ‘JavaScript Object Notation with Padding‘. They both essentially refer to the same thing but just to clear, there is a difference:
// JSON: { 'name' : 'john', 'age' : 23, 'hobbies' : ['football','cooking','rock climbing'], 'temper' : 'moody' } // JSONP: newPerson({ 'name' : 'john', 'age' : 23, 'hobbies' : ['football','cooking','rock climbing'], 'temper' : 'moody' });
As you can see, the only difference is that JSONP format requires some type of callback function with the object passed as a parameter whereas regular JSON is just a regular inline JavaScript object (the theory behind JSONP is that the callback name is specified by the requester (within the query string), not by the party which receives the request).