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>iframe js mht

解决方案 »

  1.   

    只有ie支持mht,其他浏览器都不是完全支持或需要插件。
    http://en.wikipedia.org/wiki/MHTML
      

  2.   

    在ifram里面添加一个 src=""
      

  3.   

    一个的话,这样做没问题。现在是有多个菜单,对应不同的.mht
      

  4.   

    <body>
        <button onclick="asd()"></button>
                <div title="mht" id="mhtFrame">
                    <iframe  style="POSITION: absolute;z-index: -1; width:100%;height:100%;" id="DivReport3"
                        ></iframe>
                </div>
    </body>
    </html>
    <script type="text/javascript">
        function asd() {
            var div = document.getElementById("mhtFrame");
            div.innerHTML = '<iframe style="POSITION: absolute;z-index: -1; width:100%;height:100%;" id="DivReport3" src="Template_V10.mht" ></iframe>';
        }
    </script>
      

  5.   

    ifra.src = "Template_V10.mht";  用ifra.src可能找不到src这个属性,在ifram里面添加一个src=""就可以找到这个src属性了
      

  6.   

    不是很清楚,可能是安全性原因,不允许直接把src改成mht页面