【发布时间】:2020-05-29 20:58:07
【问题描述】:
我正在尝试将 API 响应中的 iFrame 绑定到带有 id 的 div。它在 IE 中不起作用。我可以绑定 iframe,但 iframe 不显示原始 HTML:
.html 文件
<div id="div" ></div>
.ts 文件
theIframe = "<iframe srcdoc=\"<!DOCTYPE html>\n<html>\n <head>\n <script src="https://code.jquery.com/jquery-2.2.4.min.js" type="text/javascript"></script>\n <width=\"100%\" height=\"600px\" scrolling=\"no\" frameborder=\"0\"></iframe>"
document.getElementById('div').innerHTML = theIframe;
【问题讨论】:
标签: javascript html angular