dojo/request/iframe中读取xml响应的缺陷

defect in dojo/request/iframe for reading xml response

本文关键字:响应 缺陷 xml request iframe dojo 读取      更新时间:2023-10-03

我正在使用dojo/request/iframe进行文件上传。文件上传得很好,但当我试图用XML获得响应时,我总是会收到以下错误(我在FF中尝试过):

"TypeError:xmlText未定义"

我已经将handleAs属性设置为"xml",并且基于dojo/request/iframe的文档,对于xml和html中的响应,我不需要响应在标记内。我使用了Firebug,可以看到我的响应是xml格式的。

我从dojo库中读到一篇关于这可能成为缺陷的帖子,但没有后续报道:http://grokbase.com/p/dojo/dojo-checkins/12c7qyynnx/dojo-toolkit-16440-dojo-request-iframe-js-xmltext-is-undefined-error-in-ff-and-ie9

有人知道这是否真的是Dojo的缺陷吗?有什么变通办法吗?提前感谢

我也遇到了类似的问题。但也许这是误导:响应,你的xmlText不是Text,而是一个对象。对我来说像

    iframe(myForm.action, {
        handleAs: "html",
        data: data
    }).then(function(xmldoc){
        require(["dojo/dom-construct"],function(domConst){
            var new_elem = query("#"+myid,xmldoc)[0];
            if(new_elem)
               domConst.place(new_elem, elem, "replace");
            });
    }, function(err){
            // Handle the error condition
    });

做得不错。