Forum Moderators: open
The result expands & is filled with a form. In this form is javascript. When I try to use the javascript nothing happens.
The javascript is correct but I can't activate it. Is there a way to get around this? Thanks
fintan
<script type="text/javascript">
function addscript() {
var newScript = 'alert("it works!")';
var jsEl = document.createElement('script');
jsEl.type = 'text/javascript';
jsEl.appendChild(document.createTextNode(newScript));
document.body.appendChild(jsEl);
}
</script>
<input type="button" value="try me" onclick="addscript()">
Pressing the button adds a script element to the DOM. Unfortunately IE throws an error... Let's hope some guru stops by to give some proper advise :(