I have the following function:

```
loadMsgBody: function (id) {
    return dojo.xhrGet({
        url: "myurl",
        handleAs: "text",
        content: {
            id: id
        },
        load: function (response) {
            return response;
        },
        error: function (response) {
            alert(response);
        }
    });
}

```

And calling it:

```
var text = "";
this.loadMsgBody(this.msgId).then(function (response) {
    text = response;
});

```

Now I expect to get the return value of the function but instead I am getting an empty value for text. However, in Firebug I do see the response from the server with the correct value. I've searched and found these links : [DOJO xhrGet how to use returned json object?](https://stackoverflow.com/questions/4044489/dojo-xhrget-how-to-use-returned-json-object)
and:
[Using hitch / deferred with an xhrGet request](https://stackoverflow.com/questions/11157432/using-hitch-deferred-with-an-xhrget-request)
But I still can't get and store the data with the above code. I don't want to do the manipulation inside the xhrGet call, I want to retrieve the data and use as it will be used multiple times.

Is there anything I am missing?