开发者

Parsing XML with RightJS in IE?

开发者 https://www.devze.com 2023-03-05 21:59 出处:网络
I am trying to use RightJS in a new pr开发者_JAVA技巧oject. What I am trying to do is: Having a XHR request to the server

I am trying to use RightJS in a new pr开发者_JAVA技巧oject. What I am trying to do is:

  • Having a XHR request to the server
  • Retrieve a XML back
  • Parse the XML and update the page accordingly

The code works for Firefox and Safari but when I try to load it with IE I got a:

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. Is it related to RightJS unable to handle Microsoft XML obj?

Is that the proper way to handle XML in RightJS?


Got feedback from another channel that JSON is the recommended data protocol in RightJS.

So in IE if one wants to use XML she has to fallback to native XML element parsing methods.

0

精彩评论

暂无评论...
验证码 换一张
取 消