Catalyst and ajax

Hello to all,

I have a catalyst application with templates containing javascript. In one of my functions I use xmlhttprequest and call another perl subroutine. I am getting back the proper value in the xml but in addition I am getting the whole page of html.

I get my simple value and I also get http 1.0 200 ok and the the whole page of html.

This comes back in firefox error console as bad xml form.

Any ideas on how to troubleshoot this?