我正在动态创建iframe,它只包含内容(没有src属性)。
var iframe = document.createElement('iframe');
iframe.contentWindow.document.body.innerHTML= my_page_content;
....
但是,JS脚本(<my_page_content中的script src=".....")没有被加载,我必须重新加载脚本。
这些方法不能帮助我重新加载frame:
//this one emptyfies the iframe at all
iframeEleme
我正在编写一段动态加载Google字体的代码。
该页面的某些内容在iframe中加载(位于相同的域原点上)。我很难在iframe中加载和应用Web字体。我可以访问父文档和iframe。这是我的代码:
<h1>FONT to test</h1>
<p>Another FONT to test</p>
<iframe src="iframe-content.html"></iframe>
<script src="https://code.jquery.com/jquery-1.12.4.mi
在这里我想做的是:
var html = '<html><head><script src="/js/script.js"></script></head><body></body></html>';
var iframe = document.createElement('iframe');
var iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
ifram
我已经创建了一个小工具,其他人可以通过iframe加载到他们的html中。将我的自定义js文件(作为iframe src)加载到iframe中,一切都正常。我还从ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js.加载了jquery然后,我的自定义js使用$.get()以不同的时间间隔从与js文件相同的域的服务器加载和解析一些json。我使用json创建html元素,并将其添加到iframe中。再说一次,所有这些都像预期的那样工作。
我遇到的问题是,我想让我在iframe中添加的html具有动画效果。我使用以下函数来处理动画:
fu
我正在动态加载一个iframe,里面有一些要执行的代码--它是一个代码游乐场,下面有codemirror实例。在iframe中执行的一段代码是。
在加载/卸载iframe时,我得到以下错误:
TypeError: i is null
...;u(s)&&t.indexOf(s)===-1&&t.push(s)}}},u=function(e){return StyleFix.camelCase(e...
prefixfree.min.js (line 5, col 3756)
TypeError: e.fixers is undefined
...,