Q:

Google suggestions result empty data parameter

I want to add a search bar for google on my website and i've got problems with the suggestions.
The code shows the request to suggestqueries.google.com but i'm not getting any data in the data parameter.
$.get('http://suggestqueries.google.com/complete/search', {
        q: searchStr,
        client: "chrome"
    }, function (data) {
        alert(data);
    });

I've checked with wireshark. There is a response from google with the suggestions like ["hey"["hey siri", "hey ... as http message. How can I get this response from inside my code to use it as suggestions?

A:

You can use done(...):
$.get('http://suggestqueries.google.com/complete/search', {
    q: searchStr,
    client: "chrome"
}).done(function(data) { 
    //do something with the data
});

