This function will add a script tag to the page title with any content that you pass to it.
function insertScript(script_text) { var script_tag = document.createElement('script'); script_tag.type = "text/javascript"; var script = document.createTextNode(script_text); script_tag.appendChild(script); document.getElementsByTagName('head')[0].appendChild(script_tag); }
I am more familiar with jQuery than with a prototype, so I just did it in pure JS.
Translate the part in which I create the element and the part in which I get the HEAD element in Prototype if you want, but use the call to appendChild instead of the Prototype insert function, as it will just do what you ask and not evaluate JS.
Of course, now that Iβm looking at what you are asking for, you can also just try changing the code you are inserting to something like:
window.update_12345 = function() {...}
I'm not sure if this will work or not, but it's worth a try.
source share