Is there anyway of getting javascript code injected in an iframe to execute without removing and reappending the script tag containing it?
问题 Context: I am building a live HTML,CSS & Javascript editor. It can be accessed here. The source can be accessed here. Question: Is it possible to run javascript code injected into an iframe without repeated removal and addition of <script> tag containing the code from and to the DOM tree? Since DOM manipulation is a costly affair, I want to try and eliminate multiple DOM manipulations. Instead I want to be able to just change the textContent of the <script> tag and have it run the new code