I was able to get this to work perfectly by removing the dataType. It ran my success function and parsed as XML. Is this a bug?
On Jul 24, 3:01 pm, TCoakley <ebun...@gmail.com> wrote: > I am attempting a fairly easy ajax call within a zend framework, but > am getting a parseerorr. I have validated the xml and will show that > below. No js errors are being thrown. > > The ajax call: > $(function() { > $('#AjaxListAnchor').click(function() { > $.ajax({ > type: "GET", > url: "/xml/index/messages", > dataType: "xml", > error: function(XMLHttpRequest, textStatus, > errorThrown){ > alert('Error loading XML document\n' + > textStatus); > }, > > success: function(xml) { > $(xml).find('message').each(function(){ > var message = $(this).text(); > $('<li></li>') > .html(message) > .appendTo('#AjaxList'); > }); > } > }); > }); > }); > > The xml from /xml/index/messages > <?xml version="1.0" encoding="utf-8"?> > <messages> > <message>Computer science is no more about computers than astronomy > is about telescopes. </message> > <message>People think computers will keep them from making mistakes. > They're wrong. With computers you make mistakes faster. </message> > <message>Never trust a computer you can't throw out a window. </ > message> > <message>To err is human - and to blame it on a computer is even more > so.</message> > <message>A computer once beat me at chess, but it was no match for me > at kick boxing. </message> > > <message>Computing is not about computers any more. It is about > living. </message> > <message>Treat your password like your toothbrush. Don't let anybody > else use it, and get a new one every six months. </message> > </messages>