This happens in all browsers, so there must be a reason.
Example:
<html>
<body>
<script>var a="support/";
var aa='<iframe src="http://google.com/' + a + '" />';
document.write(aa)</script>
<script>alert('test')</script>
</body>
</html>
The code after the iframe write (in this case alert(‘test’)) doesn’t execute. Why?
Your HTML that you write into the document is invalid and causes the browser to fail interpreting the rest of the document, including the remaining
<script>tags.You are writing
<iframe src="http://google.com/support/. Add"></iframe>and it’s ok.However, a cleaner approach would be not to use
document.writeat all (assuming you have some HTML element with id=”container” to hold the iframe):