AJAX Component and XML

edited April 2012 in Enyo 2
Last night I was putting together an app downloading the NYC MTA Service Status XML file from http://mta.info/status/serviceStatus.txt. I set handleAs in the AJAX component to XML, but the inResponse argument to my response callback kept coming in empty. When I changed the handleAs to text or json, I'd get a string containing the XML (which I can handle).

I'm wondering if I'm doing something wrong with my call. Any advice?


  • The XML handler just means that responseXML gets returned to you. That only gets set if the XML is well-formed and it's returned with MIME type text/xml. It looks like the MTA is returning type text/plain, so that would prevent that mechanism from working.

    I'd request as text then pass it into the JS XML engine manually.
  • thanks, ben, I knew seeing ".txt" on the url would be a sign.
Sign In or Register to comment.