Reputation: 835
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>
Upvotes: 1
Views: 155
Reputation: 835
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.
Upvotes: 0
Reputation: 95488
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.
Upvotes: 1