Hi, I'm trying to import my sitemap.xml file, and the code below works when i have the alert('.....') placed in there, but the moment I remove it, the data isn't imported, can anyone help?
$.ajax({ type: "GET", url: "/sitemap.xml", dataType: "xml", success: function(xml) { var name_text; alert('got it!'); // <<<<<--------------------------------- IF LINE REMOVED, CODE BREAKS. $(xml).find('loc').each(function(){ name_text = $(this).text(); $('#sitemap').append('<div>' + name_text + '</div>'); }); //close each( } }); //close $.ajax(