javascript - Extract and execute scripts from AJAX response -
my ajax response returns this:
<div> .. </div> <script type="text/javascript"> .. </script> <script type="text/javascript"> .. </script> <div> .. </div>
i want execute scripts script tag (should work cross-browserly) , insert text (divs) page after.
your script
tags don't need type="text/javascript"
attribute cross-browser compatibility.
and javascript execute top down. whatever script comes first execute first. add text insertion last, this:
html:
<div id="mydiv"></div>
javascript:
document.getelementbyid("mydiv").innerhtml = "hello";