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

Using JSON with eval in Javascript

Expand Messages
  • Mert Sakarya
    Hello everyone, I ve got another question. I love JSON and the idea behind it. It is cool and generic. I am using JSON, with Javascript on the client-side with
    Message 1 of 3 , May 26, 2006
    • 0 Attachment
      Hello everyone,

      I've got another question. I love JSON and the idea behind it. It is cool and generic.

      I am using JSON, with Javascript on the client-side with XmlHttpRequest, but instead of parsing the object with the "parseJSON" method in the "json.js" coded at json.org, I am parsing it with the "eval" (the evil) function of javascript. This way it is parsed faster and have the ability to use the extended javascript features in generated output (eg, ability to add function). Now, the question is, can I say I am using JSON or not?

      Regards,
      Mert
      _________________________________________________________________
      Join the next generation of Hotmail and you could win the adventure of a lifetime
      http://www.imagine-msn.com/minisites/sweepstakes/mail/register.aspx

      [Non-text portions of this message have been removed]
    • MPCM
      If you say just JSON, people will assume that you are talking about the current spec. I m guessing most people use eval at least on the Javascript side. If you
      Message 2 of 3 , May 26, 2006
      • 0 Attachment
        If you say just JSON, people will assume that you are talking about the
        current spec. I'm guessing most people use eval at least on the Javascript
        side.

        If you extend it, you've simple wandered away from the spec both in your
        encoding and possibly decoding to make it work. I'd worry more about what
        your doing with it, rather than what you get to call it. Calling it json vs.
        `json that I've extended` will only come up when you misrepresent what your
        using and it concerns others.

        --
        Matthew P. C. Morley
        MPCM Technologies Inc.


        [Non-text portions of this message have been removed]
      • Atif Aziz
        ... It doesn t matter how you parse it but what you put in there that makes it JOSN or not. So if you use functions, then no, it s not JSON. If, on the other
        Message 3 of 3 , May 27, 2006
        • 0 Attachment
          > Now, the question is, can I say I am using JSON or not?

          It doesn't matter how you parse it but what you put in there that makes it JOSN or not. So if you use functions, then no, it's not JSON. If, on the other hand, you pass the functions as JSON strings and then "eval" those strings to import the functions individually, then technically, you're still doing JSON.

          -----Original Message-----
          From: json@yahoogroups.com [mailto:json@yahoogroups.com] On Behalf Of Mert Sakarya
          Sent: Friday, May 26, 2006 10:25 PM
          To: json@yahoogroups.com
          Subject: [json] Using JSON with eval in Javascript

          Hello everyone,

          I've got another question. I love JSON and the idea behind it. It is cool and generic.

          I am using JSON, with Javascript on the client-side with XmlHttpRequest, but instead of parsing the object with the "parseJSON" method in the "json.js" coded at json.org, I am parsing it with the "eval" (the evil) function of javascript. This way it is parsed faster and have the ability to use the extended javascript features in generated output (eg, ability to add function). Now, the question is, can I say I am using JSON or not?

          Regards,
          Mert
          _________________________________________________________________
          Join the next generation of Hotmail and you could win the adventure of a lifetime
          http://www.imagine-msn.com/minisites/sweepstakes/mail/register.aspx

          [Non-text portions of this message have been removed]





          Yahoo! Groups Links
        Your message has been successfully submitted and would be delivered to recipients shortly.