Results 1 to 2 of 2

Thread: Question about JSON

  1. #1
    Join Date
    Oct 2010
    Posts
    37

    Question about JSON

    I have been learning the syntax of JSON for a few days now. The syntax is not what is confusing me, but how it implemented on a web site. What is JSON used for? Is it supposed to replace the use of XML? Is it how people write OOP code in Javascript these days? Am I supposed to write OOP code in JS as JSON's syntax and not the many functions I'm so used to?

    Too many questions.
    Thanks in advance.

  2. #2
    Join Date
    Mar 2010
    Location
    Ithaca, NY, USA
    Posts
    212
    JSON is just a way to represent a JavaScript object textually. If you've ever worked with object oriented programming, it can be compared to serializing an object. It is a good replacement for XML in certain applications, for example, a JavaScript client passing information to and from a server via AJAX. JSON is immediately usable by JavaScript as an object and so you skip having to parse XML when you're sending this information back and forth.

    Most programming languages have support for decoding JSON either built in, or via a third party function. This makes it very simple to transfer objects between JavaScript and other languages with only one or two lines of code. I'm sure you see the power in that

Similar Threads

  1. AJAX, JQuery, JSON with api help needed please.
    By prionkor in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 21 Dec 2010, 07:43 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •