O'Reilly logo

Head First jQuery by Ronan Cranley, Ryan Benedetti

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Handling JSON Data: Client, Meet Server

image with no caption

As useful as reading data from an XML file was, that won’t always cut the mustard. A more efficient data interchange format (JavaScript Object Notation, aka JSON) will make it easier to get data from the server side. JSON is easier to generate and read than XML, too. Using jQuery, PHP, and SQL, you’ll learn how to create a database to store information so you can retrieve it later, using JSON, and display it on the screen using jQuery. A true web application superpower!

Webville MegaCorp’s Marketing Department doesn’t know XML

From: Webville MegaCorps Marketing

Subject: Re: 42nd Annual Bit to Byte Race results page

Hey Web Design Team,

We really like the updates you’ve made to the website.

We have a problem though: nobody in our office knows XML! So we don’t know how to add new finishers to the race website.

We’ve tried, but every time we get it wrong, it makes the website do some strange things... Finishers don’t show, or fields disappear from the page even though they’re in the XML file. It’s very odd.

What we’d really like is some way to just type into a few boxes and click a button to add a finisher. Can you make this happen?

And if we make a mistake, can you make it so we don’t break the whole site?

I know it’s only three days until we all fly out to Hawaii, but we’d really like this working before we go. Do you think you can make it in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required