title: Reading Google API JSON with jquery
body: <p>I want to get Google search results with Google ajax api then append results into the DIV.</p>
  
  <p>Google is using json to show results but unfortunately i don't know how to use it.</p>
  
  <p>I search alot but no result.</p>
  
  <p>This is my code but not work: (maybe u understand what i want to do)
  local json link worked but external link not worked !</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    jQuery(function($){
      $.getJSON('http://ajax.googleapis.com/ajax/services/search/web?v=1.0&amp;q=stack', function(data) {
      $.each(data.responseData.results, function(i, article){
      $('#searchcontrol').append('&lt;h2&gt;' + article['title'] + '&lt;/h2&gt;&lt;p&gt;' + article['content'] + '&lt;/p&gt;');
    });
  });
  </code></pre>
  
  <p>});
      </p>
  
  <p>Google json is something like this: (I wanna read this)</p>
  
  <pre><code>{
      "responseData": {
          "results": [{
              "GsearchResultClass": "GwebSearch",
              "unescapedUrl": "http://en.wikipedia.org/wiki/Stack_(abstract_data_type)",
              "url": "http://en.wikipedia.org/wiki/Stack_(abstract_data_type)",
              "visibleUrl": "en.wikipedia.org",
              "cacheUrl": "http://www.google.com/search?q\u003dcache:hhCsdZCgMlUJ:en.wikipedia.org",
              "title": "\u003cb\u003eStack\u003c/b\u003e (abstract data type) - Wikipedia, the free encyclopedia",
              "titleNoFormatting": "Stack (abstract data type) - Wikipedia, the free encyclopedia",
              "content": "In computer science, a \u003cb\u003estack\u003c/b\u003e is a particular kind of abstract data type or collection \nin which the principal (or only) operations on the collection are the addition of \u003cb\u003e...\u003c/b\u003e"
          }, {
              "GsearchResultClass": "GwebSearch",
              "unescapedUrl": "http://stackoverflow.com/",
              "url": "http://stackoverflow.com/",
              "visibleUrl": "stackoverflow.com",
              "cacheUrl": "http://www.google.com/search?q\u003dcache:U1GC2GYOToIJ:stackoverflow.com",
              "title": "\u003cb\u003eStack\u003c/b\u003e Overflow",
              "titleNoFormatting": "Stack Overflow",
              "content": "A language-independent collaboratively edited question and answer site for \nprogrammers."
          }, {
              "GsearchResultClass": "GwebSearch",
              "unescapedUrl": "http://www.stack.com/",
              "url": "http://www.stack.com/",
              "visibleUrl": "www.stack.com",
              "cacheUrl": "http://www.google.com/search?q\u003dcache:E20ImyHZCpIJ:www.stack.com",
              "title": "Get Bigger, Stronger, Better, Faster | \u003cb\u003eSTACK\u003c/b\u003e",
              "titleNoFormatting": "Get Bigger, Stronger, Better, Faster | STACK",
              "content": "Get better at the sports you play and the life you lead at \u003cb\u003eSTACK\u003c/b\u003e. Improve your \ntraining, nutrition and lifestyle with daily."
          }, {
              "GsearchResultClass": "GwebSearch",
              "unescapedUrl": "http://docs.oracle.com/javase/7/docs/api/java/util/Stack.html",
              "url": "http://docs.oracle.com/javase/7/docs/api/java/util/Stack.html",
              "visibleUrl": "docs.oracle.com",
              "cacheUrl": "http://www.google.com/search?q\u003dcache:5G3WpASlFXAJ:docs.oracle.com",
              "title": "\u003cb\u003eStack\u003c/b\u003e (Java Platform SE 7 ) - Oracle Documentation",
              "titleNoFormatting": "Stack (Java Platform SE 7 ) - Oracle Documentation",
              "content": "The \u003cb\u003eStack\u003c/b\u003e class represents a last-in-first-out (LIFO) \u003cb\u003estack\u003c/b\u003e of objects. It extends \nclass Vector with five operations that allow a vector to be treated as a \u003cb\u003estack\u003c/b\u003e."
          }],
          "cursor": {
              "resultCount": "18,800,000",
              "pages": [{
                  "start": "0",
                  "label": 1
              }, {
                  "start": "4",
                  "label": 2
              }, {
                  "start": "8",
                  "label": 3
              }, {
                  "start": "12",
                  "label": 4
              }, {
                  "start": "16",
                  "label": 5
              }, {
                  "start": "20",
                  "label": 6
              }, {
                  "start": "24",
                  "label": 7
              }, {
                  "start": "28",
                  "label": 8
              }],
              "estimatedResultCount": "18800000",
              "currentPageIndex": 0,
              "moreResultsUrl": "http://www.google.com/search?oe\u003dutf8\u0026ie\u003dutf8\u0026source\u003duds\u0026start\u003d0\u0026hl\u003den\u0026q\u003dstack",
              "searchResultTime": "0.14"
          }
      },
      "responseDetails": null,
      "responseStatus": 200
  }
  </code></pre>
  
  <p>Sorry for bad english
  Thanks alot :)</p>