It looks like the problem is that the form is submitted into generated Iframe, which doesn't have references to jquery or other JS libraries that you might be using.
I'm not too sure if there is an easy way around it as my JS/jquery skills are far from perfect. One of the dodgy solutions that come to my head would be escaping JS in your response and then when you copy it from iframe to the page remove the escaping. But i guess I'll better refactor my code to use json response and will see if it works... Cheers Kostya