I have javascript code embedded inside a html template file. When I load this template via ajax and inject it into the DOM, the javascript code isn’t functional.
Would anyone know how to get this javascript code to execute as normal?
Thanks a million!
Your Javascript probably callsdocument.write.If so, there is no solution; you need to rewrite the Javascript.
EDIT: You need to manually run the inserted
<script>blocks usingeval.jQuery can do this automatically: