tags:

views:

557

answers:

0

Anyone know why the results from the google code playground are limited to 4 items? For example:

<!--
  copyright (c) 2009 Google inc.

  You are free to copy and use this sample.
  License can be found here: http://code.google.com/apis/ajaxsearch/faq/#license
-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google AJAX Search API Sample</title>
    <script src="http://www.google.com/jsapi"&gt;&lt;/script&gt;
    <script type="text/javascript">
    /*
    *  How to load jQuery and then use the Search API with it.
    */

    google.load("jquery", "1");

    // on page load complete, fire off a jQuery json-p query
    // against Google web search
    function OnLoad(){
      var url = "http://ajax.googleapis.com/ajax/services/search/web?q=google&amp;v=1.0&amp;callback=?";
      $.getJSON(url, function (data) {
        if (data.responseData.results &&
            data.responseData.results.length > 0) {
          var results = data.responseData.results;
          var content = document.getElementById('content');
          content.innerHTML = '';
          for (var i=0; i < results.length; i++) {
            // Display each result however you wish
            content.innerHTML += results[i].titleNoFormatting + "<br/>";
          }
        }
      });
    }

    google.setOnLoadCallback(OnLoad);
    </script>
  </head>
  <body style="font-family: Arial;border: 0 none;">
    <div id="content">Loading...</div>
  </body>
</html>

Thanks, Mark