LoginSignup
3
2

More than 5 years have passed since last update.

Google Closure LibraryでAjaxする

Posted at
goog.net.XhrIo.send(this._url, function(e) {
    var xhr = e.target,
        obj = xhr.getResponseJson();

    d.callback(obj.feed.entry);
});

Instance化して使う方法

var xhr = new goog.net.XhrIo();

goog.events.listen(xhr, 'complete', function (e) {
    if (xhr.isSueccess()) {
        console.log(xhr.getResponseJson(); //getResponseText()も。
    }
    else {
        console.log(xhr.getLastError());
    }
});

xhr.send(url, 'POST', data);
3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2