js保存文件
JS脚本 2009/2/19 8:49:06 点击:不统计
关键词:js js代码,保存文件,js实现保存文件
<script>
function saveFile(T,content)
{//保存
var filename=document.all(T).value;
var win=window.open('','','top=10000,left=10000');
win.document.write(document.all(content).innerText);
win.document.execCommand('SaveAs','',filename)
win.close();
}
</script>
<form name="saveas" action="" method="post">
文件名称:<input type="text" id="title_1">
<br>
文件内容:<textarea id="content_1">
网站制作学习网
</text_area>
<br>
<input type="button" value="save as txt file" onClick=saveFile('title_1','content_1')>
</form>
·上一篇:拖动层并定位 >> ·下一篇:在桌面上浮动的图片 >>