iframe 动态连接 .mht
1. 单独在浏览器中查看 Template_V10.mht文件正常显示(该文件由excel另存成的)
2. 通过js把它加载到iframe中,有的浏览器无内容显示,有的浏览器提示“下载”
目标:通过js动态把.mht文件加载到iframe中
主要代码如下:
<body>
<button onclick="asd()"></button>
<div title="mht">
<iframe style="POSITION: absolute;z-index: -1; width:100%;height:100%;" id="DivReport3"
></iframe>
</div>
</body>
</html>
<script type="text/javascript">
function asd() {
var ifra = document.getElementById("DivReport3");
ifra.src = "Template_V10.mht";
}
</script>