Loading ...
Sorry, an error occurred while loading the content.

Re: [json] Re: JSON vs XML

Expand Messages
  • Tom Metro
    ... Remember that the X in AJAX stands for XML, so XML can also be used in the same way you described to avoid reloading web pages. The original poster wasn t
    Message 1 of 14 , Jan 17, 2007
    • 0 Attachment
      shijupc123 wrote:
      > genzoeri wrote:
      >> ...know that json is faster than xml. I want to know if anybody have the
      >> testing script or algorithm how to prove this issue?
      >
      > It is nothing but AJAX.
      > [...an explanation (of sorts) of AJAX omitted...]
      > This is the real power behind Ajax.

      Remember that the X in AJAX stands for XML, so XML can also be used in
      the same way you described to avoid reloading web pages. The original
      poster wasn't asking about traditional form submission vs. AJAX.

      The question was JSON vs. XML, and the theoretical performance advantage
      to JSON (as probably explained in the article) is that the browser
      incorporates a compiled (fast) JavaScript parser, which can handle the
      JSON data directly, and eliminates the need of writing an XML parser in
      an interpreted language. There may also be some advantages to JSON's
      more compact data format.

      However, I believe most modern browsers now have the ability to parse
      XML and provide a DOM API for accessing data stored within an XML
      sub-tree. I'm not aware of any performance comparison code, but you'd be
      better off coding something yourself that reflected your usage scenario,
      and as importantly, took advantage of the particular web browser clients
      you were targeting, as capabilities and performance will vary.

      -Tom

      --
      Tom Metro
      Venture Logic, Newton, MA, USA
      "Enterprise solutions through open source."
      Professional Profile: http://tmetro.venturelogic.com/
    • Martin Cooper
      ... Um, no, it s not. The technology behind JSON is a subset of JavaScript syntax, and nothing more. AJAX has nothing to do with JSON except insofar as you can
      Message 2 of 14 , Jan 17, 2007
      • 0 Attachment
        On 1/16/07, shijupc123 <shijupc123@...> wrote:
        >
        > --- In json@yahoogroups.com, "genzoeri" <genzoeri@...> wrote:
        > >
        > > Hii, I am newbie with json. after I read article in
        > > http://www.developer.com/lang/jscript/article.php/10939_3596836_2, I
        > > know that json is faster than xml. I want to know if anybody have the
        > > testing script or algorithm how to prove this issue?
        > > Regards,
        > > Genzoeri.
        > >
        >
        > Hi,
        >
        > I am sending some clarifications about the mail.
        > Before you going to discuss the JSON's power, you must know about the
        > technology behind it. It is nothing but AJAX.


        Um, no, it's not. The technology behind JSON is a subset of JavaScript
        syntax, and nothing more. AJAX has nothing to do with JSON except insofar as
        you can choose to use similar techniques using JSON instead of XML - but at
        that point, it is no longer AJAX.

        --
        Martin Cooper


        In normal case (Ajax disabled browsers) handling response and request
        > should be normal HTTP Request and HTTP Response. Also whenever you
        > browse a page a new request always send to the Web server. Also the
        > response will be in same manner. But in the case of Ajax enabled
        > application the Number of request should be bind in an object and send
        > that object as request. Actually this we have called JSON(Javascript
        > Object Notaion).
        >
        > This is the real power behind Ajax.
        >
        > The following sites will show the examples o AJAX and JSON
        >
        > http://download.backbase.com/webinar/2007-01-11/index.html
        >
        > http://www.clearnova.com/ajax/
        >
        >
        >
        >
        >
        >
        >
        >
        > Yahoo! Groups Links
        >
        >
        >
        >


        [Non-text portions of this message have been removed]
      • Douglas Crockford
        ... insofar as ... but at ... It s all Ajax. Ajax is the ability to produce interactive web applications that do not depend exclusively on page replacement.
        Message 3 of 14 , Jan 18, 2007
        • 0 Attachment
          > The technology behind JSON is a subset of JavaScript
          > syntax, and nothing more. AJAX has nothing to do with JSON except
          insofar as
          > you can choose to use similar techniques using JSON instead of XML -
          but at
          > that point, it is no longer AJAX.

          It's all Ajax. Ajax is the ability to produce interactive web
          applications that do not depend exclusively on page replacement. When
          Jesse James Garrett first wrote about Ajax
          [http://www.adaptivepath.com/publications/essays/archives/000385.php%5d
          he did not include JSON in his formulation because he wasn't yet aware
          of it. He did not intend to exclude it.
        • Martin Cooper
          ... Says you. But the X in AJAX stands for XML, not a variable, and the article you quote is very clear about that. Whether he knew about JSON at the time is
          Message 4 of 14 , Jan 18, 2007
          • 0 Attachment
            On 1/18/07, Douglas Crockford <douglas@...> wrote:
            >
            > > The technology behind JSON is a subset of JavaScript
            > > syntax, and nothing more. AJAX has nothing to do with JSON except
            > insofar as
            > > you can choose to use similar techniques using JSON instead of XML -
            > but at
            > > that point, it is no longer AJAX.
            >
            > It's all Ajax. Ajax is the ability to produce interactive web
            > applications that do not depend exclusively on page replacement. When
            > Jesse James Garrett first wrote about Ajax
            > [http://www.adaptivepath.com/publications/essays/archives/000385.php%5d
            > he did not include JSON in his formulation because he wasn't yet aware
            > of it. He did not intend to exclude it.


            Says you. But the X in AJAX stands for XML, not a variable, and the article
            you quote is very clear about that. Whether he knew about JSON at the time
            is irrelevant; there are plenty of other formats that he could have talked
            about, such as plain text, HTML, JavaScript, etc. But he didn't, he talked
            about XML, and he defined Ajax in terms of it.

            I'm sure that you, being Mr. JSON, would like to post facto redefine the X
            to be a variable, and therefore include JSON, but it's just not so.

            --
            Martin Cooper


            Yahoo! Groups Links
            >
            >
            >
            >


            [Non-text portions of this message have been removed]
          • Peter Michaux
            ... I agree with Douglas but I think I know where the confusion lies. In Garrett s article Ajax incorporates . . . data interchange and manipulation using XML
            Message 5 of 14 , Jan 18, 2007
            • 0 Attachment
              On 1/18/07, Douglas Crockford <douglas@...> wrote:
              >
              > > The technology behind JSON is a subset of JavaScript
              > > syntax, and nothing more. AJAX has nothing to do with JSON except
              > insofar as
              > > you can choose to use similar techniques using JSON instead of XML -
              > but at
              > > that point, it is no longer AJAX.
              >
              > It's all Ajax. Ajax is the ability to produce interactive web
              > applications that do not depend exclusively on page replacement. When
              > Jesse James Garrett first wrote about Ajax
              > [http://www.adaptivepath.com/publications/essays/archives/000385.php%5d
              > he did not include JSON in his formulation because he wasn't yet aware
              > of it. He did not intend to exclude it.

              I agree with Douglas but I think I know where the confusion lies. In
              Garrett's article

              "Ajax incorporates . . . data interchange and manipulation using XML
              and XSLT . . ."

              I think it is more functional to stop thinking of the term "Ajax" as
              an acronym and just think of it like Douglas suggests or as the name
              of the Greek hero.

              <URL: http://en.wikipedia.org/wiki/Ajax_(mythology)>

              Note "Ajax" is not all capitals in Garrett's article or for the hero.

              Peter
            • Ken Robinson
              ... I hate to burst your bubble. Actually the X stands for XMLHttpRequest as is mentioned in one the answers that follows the article. Did you read the
              Message 6 of 14 , Jan 18, 2007
              • 0 Attachment
                At 12:06 PM 1/18/2007, Martin Cooper wrote:

                >Says you. But the X in AJAX stands for XML, not a variable, and the article
                >you quote is very clear about that. Whether he knew about JSON at the time
                >is irrelevant; there are plenty of other formats that he could have talked
                >about, such as plain text, HTML, JavaScript, etc. But he didn't, he talked
                >about XML, and he defined Ajax in terms of it.

                I hate to burst your bubble.

                Actually the "X" stands for "XMLHttpRequest" as is mentioned in one
                the answers that follows the article. Did you read the Questions and
                Answers after the article. There is one answer that addresses this:


                >Q. Some of the Google examples you cite don't use XML at all. Do I
                >have to use XML and/or XSLT in an Ajax application?
                >
                >A. No. XML is the most fully-developed means of getting data in and
                >out of an Ajax client, but there's no reason you couldn't accomplish
                >the same effects using a technology like
                ><http://www.crockford.com/JSON/>JavaScript Object Notation or any
                >similar means of structuring data for interchange.


                Ken



                [Non-text portions of this message have been removed]
              • Peter Michaux
                ... From Garrett s article The name is shorthand for Asynchronous JavaScript + XML Peter
                Message 7 of 14 , Jan 18, 2007
                • 0 Attachment
                  On 1/18/07, Ken Robinson <kenrbnsn@...> wrote:
                  >
                  > At 12:06 PM 1/18/2007, Martin Cooper wrote:
                  >
                  > >Says you. But the X in AJAX stands for XML, not a variable, and the article
                  > >you quote is very clear about that. Whether he knew about JSON at the time
                  > >is irrelevant; there are plenty of other formats that he could have talked
                  > >about, such as plain text, HTML, JavaScript, etc. But he didn't, he talked
                  > >about XML, and he defined Ajax in terms of it.
                  >
                  > I hate to burst your bubble.
                  >
                  > Actually the "X" stands for "XMLHttpRequest" as is mentioned in one
                  > the answers that follows the article. Did you read the Questions and
                  > Answers after the article. There is one answer that addresses this:

                  From Garrett's article

                  "The name is shorthand for Asynchronous JavaScript + XML"

                  Peter
                • Todd Kingham
                  I am sending some clarifications about the mail. Before you going to discuss the JSON s power, you must know about the technology behind it. It is nothing but
                  Message 8 of 14 , Jan 18, 2007
                  • 0 Attachment
                    "I am sending some clarifications about the mail.
                    Before you going to discuss the JSON's power, you must know about the
                    technology behind it. It is nothing but AJAX."



                    This is factually incorrect.



                    That would be like saying XML is nothing but Ajax. JSON is merely a way to
                    serialize data-structures for inter-portability, be it storing your objects
                    in a Database or flat file, or sending it across-the-wire to syndicate data
                    between networks, platforms, languages, etc� It's just a universal way to
                    pass data around.



                    Ajax on the other hand is simply a style of writing web applications in
                    which structured data needs to be sent from the server back to the browser.
                    Although JSON is an excellent choice as a "transport layer" in
                    Ajaxapplications it is by no means the only choice. And of course JSON
                    has a
                    much broader scope then just being used to pass data back to Ajax apps.



                    The biggest advantage of JSON over XML is that it tends to be less expensive
                    in terms of size and bandwidth. But XML has built in support in most
                    languages including JavaScript. When it comes to using JSON vs. XML in
                    JavaScript I feel that JSON also offers a much simpler syntax. Of course
                    that is just my humble opinion.



                    In regard to JSON vs XML when it comes to Ajax: I've not seen any
                    benchmarking done on which is more efficient but I will have to say that in
                    my own un-scientific testing I have found JSON to out perform XML. This
                    could of course have nothing to do with JSON being faster then XML, perhaps
                    its just that my XMLparser on the server is slower then my JSONparser??? In
                    any case, since I do get a syntax/size/bandwidth advantage with JSON I feel
                    it's a much better choice.



                    My 2 cents,

                    -Todd


                    On 1/16/07, shijupc123 <shijupc123@...> wrote:
                    >
                    > --- In json@yahoogroups.com <json%40yahoogroups.com>, "genzoeri"
                    > <genzoeri@...> wrote:
                    > >
                    > > Hii, I am newbie with json. after I read article in
                    > > http://www.developer.com/lang/jscript/article.php/10939_3596836_2, I
                    > > know that json is faster than xml. I want to know if anybody have the
                    > > testing script or algorithm how to prove this issue?
                    > > Regards,
                    > > Genzoeri.
                    > >
                    >
                    > Hi,
                    >
                    > I am sending some clarifications about the mail.
                    > Before you going to discuss the JSON's power, you must know about the
                    > technology behind it. It is nothing but AJAX.
                    >
                    > In normal case (Ajax disabled browsers) handling response and request
                    > should be normal HTTP Request and HTTP Response. Also whenever you
                    > browse a page a new request always send to the Web server. Also the
                    > response will be in same manner. But in the case of Ajax enabled
                    > application the Number of request should be bind in an object and send
                    > that object as request. Actually this we have called JSON(Javascript
                    > Object Notaion).
                    >
                    > This is the real power behind Ajax.
                    >
                    > The following sites will show the examples o AJAX and JSON
                    >
                    > http://download.backbase.com/webinar/2007-01-11/index.html
                    >
                    > http://www.clearnova.com/ajax/
                    >
                    >
                    >


                    [Non-text portions of this message have been removed]
                  • Douglas Crockford
                    ... Said Garrett in his presentations at The Ajax Experience in San Francisco and at AjaxWorld in Santa Clara last year.
                    Message 9 of 14 , Jan 18, 2007
                    • 0 Attachment
                      > > When
                      > > Jesse James Garrett first wrote about Ajax
                      > > [http://www.adaptivepath.com/publications/essays/archives/000385.php%5d
                      > > he did not include JSON in his formulation because he wasn't yet aware
                      > > of it. He did not intend to exclude it.

                      > Says you.

                      Said Garrett in his presentations at The Ajax Experience in San
                      Francisco and at AjaxWorld in Santa Clara last year.
                    • genzoeri
                      I think when ajax using json as data interchange format, it s still ajax. -- Understanding Code is by far the activity at which professional developers spend
                      Message 10 of 14 , Jan 19, 2007
                      • 0 Attachment
                        I think when ajax using json as data interchange format, it's still ajax.

                        --
                        Understanding Code is by far the activity at which professional
                        developers spend most of their time ....
                        Is there make any sense ????
                        [ Genzoeri ]
                      • genzoeri
                        AJAX is not specific to a particular programming language, data exchange format, or network communications. So when we use json as data exchange format, we
                        Message 11 of 14 , Jan 19, 2007
                        • 0 Attachment
                          AJAX is not specific to a particular programming language, data
                          exchange format, or network communications. So when we use json as
                          data exchange format, we still call it as AJAX. Please check this out:
                          http://www.developer.com/design/article.php/3526681
                          Any comment?
                          Regards,
                          Genzoeri.
                          --- In json@yahoogroups.com, genzoeri <genzoeri@...> wrote:
                          >
                          > I think when ajax using json as data interchange format, it's still
                          ajax.
                          >
                          > --
                          > Understanding Code is by far the activity at which professional
                          > developers spend most of their time ....
                          > Is there make any sense ????
                          > [ Genzoeri ]
                          >
                        Your message has been successfully submitted and would be delivered to recipients shortly.