这种情况在所有浏览器中都会发生,所以一定是有原因的。
例子:
<html>
<body>
<script>var a="support/";
var aa='<iframe src="http://google.com/' + a + '" />';
document.write(aa)</script>
<script>alert('test')</script>
</body>
</html>
iframe 写入后的代码(在本例中为 alert('test'))不执行。为什么?