call back is sent to the deferred then parameter::
require(["dojo/request/script", "dojo/dom", "dojo/dom-construct", "dojo/json", "dojo/on", "dojo/domReady!"],
function (script, dom, domConst, JSON, on) {
on(dom.byId("startButton"), "click", function () {
domConst.place("<p>Requesting...</p>", "ret");
script.get("http://ajax.googleapis.com/ajax/services/search/web", {
jsonp: "callback",
query: {
"v": "1.0",
"q": "internet kittens"
}
}).then(function (data) {
//Call you function here, or deal with data
domConst.place("<p>response data: <code>" + JSON.stringify(data) + "</code></p>", "ret");
});
});
});
Fiddle::http://jsfiddle.net/D49GP/
UPDATE You will not be able to use the normal dojo syntax for this one. The problem is that when dojo creates the callback for the then, it creastes the call back function in object.method format. This does not work because google is using window[nameoffunction] for the call back. So since you can manually add parameters for the script IO. use below:
script.get("https://apis.google.com/js/client.js", {
//jsonp: "onload",
query: {
onload:<callbackfunction>
}
})