Lets suppose that I have the following markup:
<div id="placeHolder">
</div>
and I have a javascript variable jsVar that contains some markup and some javascript.
By using Mootools 1.1 I can inject the javascript content to the placeholder like this:
$('placeHolder').setHTML(jsVar);
This works in Firefox, Opera and even Safari and the resulting markup looks like this:
<div id="placeHolder">
<strong>I was injected</strong>
<script type="text/javascript">
alert("I was injected too!");
</script>
</div>
However, on IE 8 I get the following:
<div id="placeHolder">
<strong>I was injected</strong>
</div>
Is there any way to inject the javascript on IE 8 or does it security model forbid me from doing this at all?
EDIT
I just tried Luca Matteis suggestion of using
document.getElementById("placeHolder").innerHTML = jsVar;
instead of the MooTools code and I get the same result. This is not a MooTools issue.