1

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>

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.