I have a code that adds dynamic text to a page:
However, sometimes the text contains actual javascript. It seems it won't run because the page already loaded.Code:document.getElementById("dynamic").innerHTML = text
Can you help me add a child, etc. to get it running? The steps are:
- Display the part before the script.
- Run the script.
- Display the part after the script.
For example:
Thanks!Code:text = "display this text, run this code <script>alert('foobar')</script> and then display this text."


Reply With Quote

Bookmarks