I'm using Prototype insert function to appent some html which contains <script>...</script>
. And within this script I'm defining a new function. And as I read here Prototype runs script that is inside <script>
tags and then removes it, but all functions should remain accessible. But from that moment I can't run my new function.
$('some_id').insert({ bottom: '<script> ... </script>' });
How to solve it? The best would be that it won't remove <script>
tags.
EDIT:
By now I did it like this:
var add_here = document.getElementById('prepayment_group_items');
var src = document.createElement('div');
src.innerHTML = 'a lot of html with script tags';
add_here.appendChild(src);