Information Technology Reference
In-Depth Information
Now, you might be asking why I'd want people to view my website somewhere other
than at its usual web address. The simple answer is that it might be more convenient for
my users to view all the blogs they read (mine and others) within one piece of software.
Software, such as Google Reader, can keep track of hundreds of RSS feeds, from news
sources, blogs, and even just simple status updates like my Twitter feed. All of these
pieces of information are retrieved by Google Reader in a format known as Extensible
Markup Language (XML). XML isn't a format you'd want to have your human viewers
see, but it is one that you'd want to use if you were sharing information between web
pages or between web services.
While the example above shows XML as an output, the web application that powers my
blog (WordPress) produces the XML so other sites like Google Reader can use it. XML
can also be used as an input. For example, I might want to take data (such as sports
scores) and display them on my webpage. Most likely, those sports scores will be
available in XML, which my web page can then open and parse . Parsing is simply a
fancy term that means “read, interpret, and display”. My webpage will read the scores,
interpret them if necessary (i.e., calculate something, aggregate something), and then
display them to the user in some meaningful way.
So to recap, we've now seen how to build a basic webpage, how to make it look pretty
(easily), and how to make it interact with a user. Finally, we talked about how webpages
and programs get data between each other by using XML. As we move through the
book, we'll talk in depth about each of these areas and give you plenty of examples of
how to use them. In fact, coming up in Chapter 2, we'll discuss how to get data from a
very popular web service and display it in the first full application we'll create!
JSON: Human-Readable Data Interchange
If you have a brilliant idea for a mobile web application that relies on the application
programming interface, or API, of other services, such as Twitter or Foursquare, then
chances are you will be quickly introduced to JSON (JavaScript Object Notation), which
is one of my favorite technologies.
JSON is a human-readable, super-lightweight data interchange technology that is based
on JavaScript. Basically, it is a JavaScript object that can be used to transmit simple
data structures and arrays of information. When it comes to working with external data
in your web application, I have fallen in love with JSON for its ease of use when
compared to other technologies such as XML. As with all technologies though, your
mileage may vary.Figure 1-10 shows an example of what a JSON document would look
like.
 
Search WWH ::




Custom Search