页面上有一个TextArea控件。
用来显示值内容
有一个连接。
要实现:
点击连接弹出来一个有“打开”,“保存”,“取消”三个按钮那种的对话框。
将TextArea控件的值通过文档形式下载到本地磁盘。
需要用JS实现。。
各位高手们帮帮忙。
感谢。感谢

解决方案 »

  1.   

      <textarea id="t1" rows="10" style="width:100px"></textarea>
            <input type="button"  value="保存" onclick="javascript:javascript:GoSave();"/><script>
     function GoSave()
     {
         var frame = document.createElement("IFRAME");
      
       document.body.appendChild(frame);
       frame.contentWindow.document.write(document.getElementById("t1").innerHTML);
       frame.contentWindow.document.execCommand("saveAs");
        
     }
     
     
    </script>