AJAX - The Complete Reference

(avery) #1

PART III


Chapter 10: Web Services and Beyond 509


Now let’s see how this works and why we said “Ajax style.” First, we note the inclusion
of a <script> tag in our example page with an API key.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Chapter 10 - Google AJAX Search API Google Parsed </title>
<!--
Do not use this Google API key as it only works on this site
and in this directory.
-->
<script src="http://www.google.com/jsapi?key=XXX-GET-YOUR-OWN-API-KEY-XXX" type=
"text/javascript"></script>

Like most public Web Services, to avoid abuse Google makes you register for an access
key to use their services. What is interesting about this call is that it is also a bootstrap
mechanism that is loading in the script that powers this facility.
Free download pdf