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

Posted wennice

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了It isn't possible to write into a document from an asynchronously-loaded相关的知识,希望对你有一定的参考价值。

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的主要内容,如果未能解决你的问题,请参考以下文章

Can't bind to 'formGroup' since it isn't a known property of 'form'

Template parse errors: Can't bind to 'ngModel' since it isn't a known property of &#

Can't convert the date-like value to string because it isn't known if it's a date (no ti

Can‘t bind to ‘ngModel‘ since it isn‘t a known property of ‘xxx‘

Can‘t bind to ‘ngModel‘ since it isn‘t a known property of ‘xxx‘

Can‘t bind to ‘ngModel‘ since it isn‘t a known property of ‘xxx‘