title: Calling Google Ajax Search API via JQuery JSONP
body: <p>I know this has been asked a zillion times, but I still can't get my code to work.  I am trying to a simple JSONP call from my Javascript application.  The cod fragment looks like:</p>
  
  <pre><code>url="http://ajax.googleapis.com/ajax/services/search/web?v=1.0&amp;q=AAA&amp;callback=?";
  </code></pre>
  
  <p>and then either:</p>
  
  <pre><code>$.getJSON(url, function(data) {
      alert('hello 1');
    });
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>$.ajax({url: url,
      datatype: 'jsonp',
      success: function(data) { alert("hello 2"); },
      error: function(j, t, e) {  alert(t);}
  });
  </code></pre>
  
  <p>Neither approach works.  The second approach results in the alert of "error".  The first does not return success either.  What am I doing wrong?  Many, many thanks!!</p>
  
  <p>UPDATE: I think I found at least one problem.  Let me look more into this.  </p>
  
  <p>UPDATE 2: Sorry, this code actually works, at least the first approach.  There was a subtle error around this code fragment that resulted in the code not working, but overall this works just fine.  Asynchronous calls are sometimes a little tricky :-)</p>