.ajax() Not Reading Returned XML Data
Hello everyone.
The request is being made successfully to the server. The server
is returning the xml data because I see it in Firebug. It returns a string that is a
copy of the page and at the end it has my xml data. So the return info looks like this:
<html>
//copy of full page plus scripts
</html><?xml version="1.0" encoding="utf-8"?><comments> (all of the xml data) </comments>
Why it's returning a string, I'm not sure because I send the header info too in the php code:
header('Content-Type: text/xml');
echo $xml;
The ajax call is simple:
- $.ajax({
- url:pageloc,
- type: "post",
- data: dataobjnew,
- dataType: 'xml',
- success: function(xml) {
- alert(xml);
- }
- });
Any idea on what's going on?