views:

62

answers:

2
+1  Q: 

XML jQuery Problem

This code for parsing my xml and appending via jquery seems to work great in every browser but Chrome (Mac only, the windows version of chrome works fine) and explorer. I'm not aware of any glaring issues in the code so I thought some fresh eyes might help. Anyone know what could be causing IE and Chrome on the mac to not append?

<script type="text/javascript" charset="utf-8">
$(document).ready(function()
    {
      $.ajax({
        type: "GET",
        url: "sitenav.xml",
        dataType: "xml",
        success: parseXml
      });

    function  parseXml(xml)
    {
      $(xml).find("GoogleAnalytics").each(function()
      {
        $("li#google_analytics").append('<ul><li>' + $(this).find("NavHeader").text()  + '</li></ul>');
      });
    }
});
</script>
+1  A: 

Can you verify that the success handler gets called? Also, it's good practice to define the error handler so that you can handle any errors in the request.

Vivin Paliath
A: 

Problem solved. I wasn't bright enough to realize that IE and Chrome (mac) need the page live on the server to work... Putting the code live, as opposed to local, worked fine.

Llamabomber