I'm using eval() to execute all <script> tags after total rewrite of a div.
$("#content").find("script").each(function(){
eval($(this).text());
});
It works well for inline-scripts, but has no effect on scripts like:
<script src="/path/to/externalScript.js"></script>
How come? Can I "force" the browser to load and execute also the external scripts?
$(this).text()contain? Likely nothing as thescriptelement doesn't have text content. You'd want to perform an Ajax request for the script, read its text content, and callevalon that.