我将 responseXml 作为 javascript 对象 XMLdocument 取回。我如何解析它以返回身体?这是我的代码片段:
goog.net.XhrIo.send("/blogs/create?authenticity_token="+
goog.string.urlEncode(authtoken), function(e) {
var xhr = /** @type {goog.net.XhrIo} */ (e.target);
var responseXml = xhr.getResponseXml();
var parent = goog.dom.getElement('response');
goog.dom.setTextContent(parent, responseXml.body); /** This returns
undefined rather than the body itself! */
}, 'POST', "&body="+goog.string.urlEncode(someHTMLContent), {
'Accept' : 'text/xml'
});