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

632Re: [json] json as js variable

Expand Messages
  • Matthew Morley
    Dec 18, 2006
      You would have to do something more than a simple translation.

      If your end goal was to directly reference fields values by name, you would
      need to do an end translation back to the object format in which you were
      trying to avoid by duplicating names. Just a loop to recreate the data
      object from the two arrays.

      You have the knowledge of the fields names and could do your looping in
      another manner, without direct reference anyway. Depends how exposed it is I
      suppose and what level of work you want consumers of the data to do/know. I
      found gzip an easier alternative than object rebuilding when looking at
      performance in my projects

      Depending on the size of your data and lots of other items, it is likely to
      be faster for transmitting due to reduced payload, but it requires you to
      deal with the arrays and not objects unless you rebuild them.

      var row = MyStuff.u80020;
      var field_ISWEATHER = 3;
      var val = MyStuff.u80020[field_ISWEATHER];

      Matthew P. C. Morley
      MPCM Technologies Inc.

      [Non-text portions of this message have been removed]
    • Show all 19 messages in this topic