zoukankan      html  css  js  c++  java
  • 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);
  • 相关阅读:
    IDEA快捷的添加包名
    Spring源码(一)
    Java的理解
    剪绳子
    机器人的运动范围
    矩阵中的路径
    N皇后问题
    回溯法
    全排列
    反转链表
  • 原文地址:https://www.cnblogs.com/wennice/p/9177050.html
Copyright © 2011-2022 走看看