Author Topic: JSON  (Read 2183 times)

Mike

  • Jackass In Charge
  • Posts: 11257
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
JSON
« on: October 06, 2008, 10:58:19 AM »
I was telling a friend how much I hated doing XML processing in javascript to do AJAX and he tells me about JSON.  Much much much nicer format for this.  And PHP 5.2 even includes a function to take your object and return JSON code.

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Re: JSON
« Reply #1 on: October 06, 2008, 11:04:56 AM »
I'm suprised theres something i have used that you werent aware of lol. I found out for the first time just over a month ago from a friend of mine who does web development in Riverside.
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

hans

  • Guitar Addict
  • Jackass In Charge
  • Posts: 3523
  • Karma: +46/-18
Re: JSON
« Reply #2 on: October 06, 2008, 11:55:38 AM »
It's the new XML. Since you're just going to turn it into Javascript anyways, may as well just start there.

We do both where I work, but do mostly the JSON stuff with the web programming.
This signature intentionally left blank.

Mike

  • Jackass In Charge
  • Posts: 11257
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
Re: JSON
« Reply #3 on: October 06, 2008, 03:20:46 PM »
I'm suprised theres something i have used that you werent aware of lol. I found out for the first time just over a month ago from a friend of mine who does web development in Riverside.
AJAX is an area that I haven't spend much time using.  I understand it well enough to recongize when it is and isn't a good use.

It's the new XML. Since you're just going to turn it into Javascript anyways, may as well just start there.
Seriously!  I was able to dump a PHP array to JSON, load it up in JS, and run for each loops over the thing to get my data out.

I do need to sit down and look for a better way then using eval to make sure I don't get raped by some security problems.

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14310
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
Re: JSON
« Reply #4 on: October 06, 2008, 08:17:13 PM »
I guess I'm one of the few that doesn't or hasn't used XML with AJAX yet.  I just send straight data back and forth, no XML necessary.