日期:2014-05-17  浏览次数:20773 次

html中如何打开或另存为xls文件?
HTML code
<html>
    <script>
    function ff(){
        url ="http://localhost/ana/formula.xls" ;
        window.open(url);
    }
</script>
    <body>
<a onclick="ff()" target="_blank">help</a> 
</body>
</html>


想点击链接,然后出现“另存为”,“打开”对话框, 我现在一点链接就会在另一个窗口出现乱码,该怎么做啊?谢谢!

------解决方案--------------------
程序没问题
你web服务器问题或浏览器问题吧
------解决方案--------------------
<a href="http://localhost/ana/formula.xls" target="_blank">help</a>
------解决方案--------------------
<a onclick="ff()" target="_blank">help</a>
改成
<a onclick="ff()" target="_blank" href="javascript:void(0);">help</a>

再试试