首页 > 其他 > 详细

It isn't possible to write into a document from an asynchronously-loaded

时间:2018-06-13 13:57:03      阅读:136      评论:0      收藏:0      [点我收藏+]

It isn‘t possible to write into a document from an asynchronously-loaded

今天遇到了一个问题:

通过document.write() 输出一个iframe 标签的时候 提示错误

Failed to execute ‘write‘ on ‘Document‘: It isn‘t possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened. 

在chrom上面就提示”Failed to execute ‘write‘ on ‘Document‘: It isn‘t possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened. “

 

解决方法  

var iframeStr = document.createElement(‘iframe‘);
document.getElementsByTagName(‘body‘)[0].appendChild(iframeStr);

It isn't possible to write into a document from an asynchronously-loaded

原文:https://www.cnblogs.com/wennice/p/9177050.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!