简体   繁体   English

在IE中使用RightJS解析XML?

[英]Parsing XML with RightJS in IE?

I am trying to use RightJS in a new project. 我正在尝试在新项目中使用RightJS。 What I am trying to do is: 我正在尝试做的是:

  • Having a XHR request to the server 向服务器发出XHR请求
  • Retrieve a XML back 取回XML
  • Parse the XML and update the page accordingly 解析XML并相应地更新页面

The code works for Firefox and Safari but when I try to load it with IE I got a: 该代码适用于Firefox和Safari,但是当我尝试使用IE加载时,我得到了:

Object doesn't support this property or method error 对象不支持此属性或方法错误

The code is simplified as follow: 该代码简化如下:

1: Xhr.load('get_xml.php', {
2:  onSuccess: function(r) {        
3:    var xml_obj = $(r.repsonseXML);
4:    var children = xml_obj.find('my_node');
5:  }
6: });

on line 3 IE gives an error. 在第3行IE上显示错误。 Is it related to RightJS unable to handle Microsoft XML obj? 它与RightJS无法处理Microsoft XML obj有关吗?

Is that the proper way to handle XML in RightJS? 这是在RightJS中处理XML的正确方法吗?

Got feedback from another channel that JSON is the recommended data protocol in RightJS. 从另一个渠道得到反馈,JSON是RightJS中推荐的数据协议。

So in IE if one wants to use XML she has to fallback to native XML element parsing methods. 因此,在IE中,如果要使用XML,则必须使用本机XML元素解析方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM