I can find the JS and HTML code in response by alert(). But i cannot append JS from response to body tag however HTML is appending fine.
new Ajax.Request(product_url, {
method: 'post',
onSuccess: function(transport) {
$$('body')[0].insert(transport.responseText);
}
});
this gives the solution.