Reputation: 1552
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);
}
});
Upvotes: 1
Views: 742
Reputation: 1552
new Ajax.Request(product_url, {
method: 'post',
onSuccess: function(transport) {
$$('body')[0].insert(new Element("div",{id:"popup"}));
$('popup').innerHTML = transport.responseText;
}
});
this gives the solution.
Upvotes: 1