a.php中异步请求b.php, 在b.php中引用了外部了js(http://www.google.com/test.js) , test.js中document.write(), 但发现直接运行b.php, test.js中的document.write()可以运行。但a.php异步请求b.php时,b.php中的document.write()不能运行。
google了一下,结果是异步请求的文件中document.write失效。但为什么会这样,暂时还没找到答案。
或者这种情况也是这样的
<div id="craftysyntax">
<script type="text/javascript">
(function() {
// csc = "Crafty Syntax Chat"
var csc = document.createElement('script');
csc.type = 'text/javascript';
csc.async = true;
csc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'example.com/chat/livehelp_js.php?eo=1&department=2&serversession=1&pingtimes=15' + ('https:' == document.location.protocol ? '&secure=Y' : '');
var s = document.getElementById('craftysyntax');
s.appendChild(csc, s);
})();
</script>
</div>
FF中会报:A call to document.write() from an asynchronously-loaded external script was ignored.