Hi Bruce,
Bruce McKenzie <suppressed> wrote:
> What I want to do is return XML (as an Ajax response) to the jQuery
> Interface library Autocomplete plugin [...]
>
> Of the modules on CPAN that could produce this XML structure, which
> would be *easiest* to use? Do I need to change the headers of the
> CGI::Application response?
Others have answered the first question (I use XML::Simple, too!).
But as for your second question, the answer is yes. Regardless of the AJAX framework you use, the xml response must have the Content-Type: text/xml for some browsers to be able to parse it into a full-fledged XML document object (and not simply as plain text).
Why do you care? Well, if your code (or your framework) asks for xml it may expect to find the xml document objext in the ajax request's reponseXML property to be able to call DOM functions on it (those same handy functions used in Javascript to traverse the current HTML page document, like childNodes(), nextSibling, getElementsByTagName() and so forth).
Google http://www.google.com/search?q=ResponseXML+Content-Type for more on the issues that arise if you try this in various browsers, and don't set your content-type header correctly.
hth,
-dave
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.