views:

128

answers:

1

Hi, I am using jQuery.ajax to parse some xml from a file. Everything works fine in IE (6,7,8), Firefox, Opera and Safari, but fails with Google Chrome. Here is the code:

/* ... */
this.loadXml = function()
{
 $.ajax(
 {
  type: "GET",
  url: "some_file.xml",
  dataType: ($.browser.msie) ? "text" : "xml",
  success: function(xml)
  {
   if($.browser.msie)
   {
    var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
    xmlDoc.loadXML(xml);
    xml = xmlDoc;
   }

  /* parsing starts here */
  /* for example: in the document I have a div tag with id "some text" and the xml file contains: <root><tag>test</tag></root>*/

  $("#some_id").text($(xml).find("root > tag").text());

  /* parsing ends here */

  }
 });
}
A: 
Pointy
Yeah... that seems to be the problem... Thanks for the quick reply!
Vassilen Dontchev