sask
02-02-2007, 12:06 PM
Hi everybody,
I was playing around this since a while, without any succes, then I left it as it was. Now I have another place, where it would be quite useful for me.
Let's say, there is an existing div tga.
I give some content to the innerHTML of the div. The new content has soma javascript code, but as we know, the interpreter will not intrpret the new content. How could I get triggered the div tag from "itself"?
I would like to get the alert executed... The text appears, but the alert does not... Any idea. Please help me.
Gregor
<div id="myid">Old content</div>
<script>
oElement = document.getElementById('myid');
oElement.innerHTML='New content<script>new Function("alert(\'I would like to see this\');");<\/script>';
</script>
____________________
Proactiv Solution (http://www.crescatsententia.org) Fine architectural fiberglass columns (http://www.worthingtonmillwork.com)
I was playing around this since a while, without any succes, then I left it as it was. Now I have another place, where it would be quite useful for me.
Let's say, there is an existing div tga.
I give some content to the innerHTML of the div. The new content has soma javascript code, but as we know, the interpreter will not intrpret the new content. How could I get triggered the div tag from "itself"?
I would like to get the alert executed... The text appears, but the alert does not... Any idea. Please help me.
Gregor
<div id="myid">Old content</div>
<script>
oElement = document.getElementById('myid');
oElement.innerHTML='New content<script>new Function("alert(\'I would like to see this\');");<\/script>';
</script>
____________________
Proactiv Solution (http://www.crescatsententia.org) Fine architectural fiberglass columns (http://www.worthingtonmillwork.com)