用jquery如何写点击一个按钮弹出一个对话框可以保存文件的代码,因为刚接触这个库,麻烦高手写个实例,谢谢

解决方案 »

  1.   

    保存文件不是js做的,直接a连接到你的下载文件就行了
      

  2.   

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
        <script type="text/javascript" >
            $(document).ready(function () {            $("#Download").click(function (e) {
                   e.preventDefault();  //stop the browser from following
                   window.location.href = 'http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/3.gif';//文件位置
               });
              
            });
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <input id="Download" type="button" value="button" />
        </div>
        </form>
    </body>
    </html>